Mercurial > hg > nginx-site
comparison xml/en/docs/njs/cli.xml @ 2245:87a0e2c73a25
Refactored njs documentation.
author | Yaroslav Zhuravlev <yar@nginx.com> |
---|---|
date | Mon, 24 Sep 2018 19:10:29 +0300 |
parents | |
children | 32ba43abf9cd |
comparison
equal
deleted
inserted
replaced
2244:467aef18bf12 | 2245:87a0e2c73a25 |
---|---|
1 <?xml version="1.0"?> | |
2 | |
3 <!-- | |
4 Copyright (C) Nginx, Inc. | |
5 --> | |
6 | |
7 <!DOCTYPE article SYSTEM "../../../../dtd/article.dtd"> | |
8 | |
9 <article name="Command-line interface" | |
10 link="/en/docs/njs/cli.html" | |
11 lang="en" | |
12 rev="1"> | |
13 | |
14 <section> | |
15 <para> | |
16 njs scripts development and debugging can be performed | |
17 from the command-line. | |
18 The command-line utility is available after the installation of | |
19 the Linux <link doc="install.xml" id="install_package">package</link> | |
20 or after building from the | |
21 <link doc="install.xml" id="install_sources">sources</link>. | |
22 Compared to njs running inside nginx, | |
23 nginx objects | |
24 (<link doc="njs_api.xml" id="http">HTTP</link> and | |
25 <link doc="njs_api.xml" id="stream">Stream</link>) | |
26 are not available in the utility. | |
27 <example> | |
28 $ echo "2**3" | njs - | |
29 8 | |
30 | |
31 $ njs | |
32 >> var o = {a:[]} | |
33 undefined | |
34 | |
35 >> JSON.stringify(o, undefined,1) | |
36 { | |
37 "a": [ | |
38 | |
39 ] | |
40 } | |
41 >> | |
42 </example> | |
43 </para> | |
44 | |
45 </section> | |
46 | |
47 </article> |