comparison xml/en/docs/njs/cli.xml @ 2521:bb0a2fbdc886

Updated example in njs cli.
author Yaroslav Zhuravlev <yar@nginx.com>
date Mon, 06 Apr 2020 11:17:11 +0100
parents b9144a131eff
children
comparison
equal deleted inserted replaced
2520:3ca5edd3ada3 2521:bb0a2fbdc886
7 <!DOCTYPE article SYSTEM "../../../../dtd/article.dtd"> 7 <!DOCTYPE article SYSTEM "../../../../dtd/article.dtd">
8 8
9 <article name="Command-line interface" 9 <article name="Command-line interface"
10 link="/en/docs/njs/cli.html" 10 link="/en/docs/njs/cli.html"
11 lang="en" 11 lang="en"
12 rev="3"> 12 rev="4">
13 13
14 <section> 14 <section>
15 <para> 15 <para>
16 njs scripts development and debugging can be performed 16 njs scripts development and debugging can be performed
17 from the command-line. 17 from the command-line.
27 <example> 27 <example>
28 $ echo "2**3" | njs -q 28 $ echo "2**3" | njs -q
29 8 29 8
30 30
31 $ njs 31 $ njs
32 >> var o = {a:[]} 32 >> globalThis
33 undefined 33 global {
34 34 njs: njs {
35 >> JSON.stringify(o, undefined,1) 35 version: '0.3.9'
36 { 36 },
37 "a": [ 37 global: [Circular],
38 38 process: process {
39 ] 39 argv: [
40 '/usr/bin/njs'
41 ],
42 env: {
43 PATH: '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
44 HOSTNAME: 'f777c149d4f8',
45 TERM: 'xterm',
46 NGINX_VERSION: '1.17.9',
47 NJS_VERSION: '0.3.9',
48 PKG_RELEASE: '1~buster',
49 HOME: '/root'
50 }
51 },
52 console: {
53 log: [Function: native],
54 dump: [Function: native],
55 time: [Function: native],
56 timeEnd: [Function: native]
57 },
58 print: [Function: native]
40 } 59 }
41 >> 60 >>
42 </example> 61 </example>
43 </para> 62 </para>
44 63