source: trip-planner-front/node_modules/regjsparser/node_modules/jsesc/man/jsesc.1@ 6a3a178

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

initial commit

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