source: trip-planner-front/node_modules/jsesc/man/jsesc.1@ b738035

Last change on this file since b738035 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 2.8 KB
RevLine 
[6a3a178]1.Dd May 13, 2016
2.Dt jsesc 1
3.Sh NAME
4.Nm jsesc
5.Nd escape strings for use in JavaScript string literals
6.Sh SYNOPSIS
7.Nm
8.Op Fl s | -single-quotes Ar string
9.br
10.Op Fl d | -double-quotes Ar string
11.br
12.Op Fl w | -wrap Ar string
13.br
14.Op Fl e | -escape-everything Ar string
15.br
16.Op Fl 6 | -es6 Ar string
17.br
18.Op Fl l | -lowercase-hex Ar string
19.br
20.Op Fl j | -json Ar string
21.br
22.Op Fl p | -object Ar string
23.br
24.Op Fl p | -pretty Ar string
25.br
26.Op Fl v | -version
27.br
28.Op Fl h | -help
29.Sh DESCRIPTION
30.Nm
31escapes strings for use in JavaScript string literals while generating the shortest possible valid ASCII-only output.
32.Sh OPTIONS
33.Bl -ohang -offset
34.It Sy "-s, --single-quotes"
35Escape any occurrences of ' in the input string as \\', so that the output can be used in a JavaScript string literal wrapped in single quotes.
36.It Sy "-d, --double-quotes"
37Escape any occurrences of " in the input string as \\", so that the output can be used in a JavaScript string literal wrapped in double quotes.
38.It Sy "-w, --wrap"
39Make sure the output is a valid JavaScript string literal wrapped in quotes. The type of quotes can be specified using the
40.Ar -s | --single-quotes
41or
42.Ar -d | --double-quotes
43settings.
44.It Sy "-6, --es6"
45Escape any astral Unicode symbols using ECMAScript 6 Unicode code point escape sequences.
46.It Sy "-e, --escape-everything"
47Escape all the symbols in the output, even printable ASCII symbols.
48.It Sy "-j, --json"
49Make sure the output is valid JSON. Hexadecimal character escape sequences and the \\v or \\0 escape sequences will not be used. Setting this flag enables the
50.Ar -d | --double-quotes
51and
52.Ar -w | --wrap
53settings.
54.It Sy "-o, --object"
55Treat the input as a JavaScript object rather than a string. Accepted values are flat arrays containing only string values, and flat objects containing only string values.
56.It Sy "-p, --pretty"
57Pretty-print the output for objects, using whitespace to make it more readable. Setting this flag enables the
58.It Sy "-l, --lowercase-hex"
59Use lowercase for alphabetical hexadecimal digits in escape sequences.
60.Ar -o | --object
61setting.
62.It Sy "-v, --version"
63Print jsesc's version.
64.It Sy "-h, --help"
65Show the help screen.
66.El
67.Sh EXIT STATUS
68The
69.Nm jsesc
70utility exits with one of the following values:
71.Pp
72.Bl -tag -width flag -compact
73.It Li 0
74.Nm
75successfully escaped the given string and printed the result.
76.It Li 1
77.Nm
78wasn't instructed to escape anything (for example, the
79.Ar --help
80flag was set); or, an error occurred.
81.El
82.Sh EXAMPLES
83.Bl -ohang -offset
84.It Sy "jsesc 'foo bar baz'"
85Print an escaped version of the given string.
86.It Sy echo\ 'foo bar baz'\ |\ jsesc
87Print an escaped version of the string that gets piped in.
88.El
89.Sh BUGS
90jsesc's bug tracker is located at <https://github.com/mathiasbynens/jsesc/issues>.
91.Sh AUTHOR
92Mathias Bynens <https://mathiasbynens.be/>
93.Sh WWW
94<https://mths.be/jsesc>
Note: See TracBrowser for help on using the repository browser.