Mercurial > hg > nginx-site
annotate xml/ru/docs/njs/cli.xml @ 2727:0456ea786ef6
Advisory link.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Tue, 25 May 2021 18:58:55 +0300 |
parents | bb0a2fbdc886 |
children |
rev | line source |
---|---|
2245
87a0e2c73a25
Refactored njs documentation.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
1 <?xml version="1.0"?> |
87a0e2c73a25
Refactored njs documentation.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
2 |
87a0e2c73a25
Refactored njs documentation.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
3 <!-- |
87a0e2c73a25
Refactored njs documentation.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
4 Copyright (C) Nginx, Inc. |
87a0e2c73a25
Refactored njs documentation.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
5 --> |
87a0e2c73a25
Refactored njs documentation.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
6 |
87a0e2c73a25
Refactored njs documentation.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
7 <!DOCTYPE article SYSTEM "../../../../dtd/article.dtd"> |
87a0e2c73a25
Refactored njs documentation.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
8 |
87a0e2c73a25
Refactored njs documentation.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
9 <article name="Интерфейс командной строки" |
87a0e2c73a25
Refactored njs documentation.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
10 link="/ru/docs/njs/cli.html" |
87a0e2c73a25
Refactored njs documentation.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
11 lang="ru" |
2521
bb0a2fbdc886
Updated example in njs cli.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2286
diff
changeset
|
12 rev="4"> |
2245
87a0e2c73a25
Refactored njs documentation.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
13 |
87a0e2c73a25
Refactored njs documentation.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
14 <section> |
87a0e2c73a25
Refactored njs documentation.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
15 <para> |
87a0e2c73a25
Refactored njs documentation.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
16 Создание и отладка njs-скриптов может осуществляться |
87a0e2c73a25
Refactored njs documentation.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
17 в командной строке. |
87a0e2c73a25
Refactored njs documentation.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
18 Утилита командной строки доступна после установки |
87a0e2c73a25
Refactored njs documentation.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
19 <link doc="install.xml" id="install_package">пакета</link> Linux |
87a0e2c73a25
Refactored njs documentation.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
20 или после сборки из |
87a0e2c73a25
Refactored njs documentation.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
21 <link doc="install.xml" id="install_sources">исходных файлов</link>. |
87a0e2c73a25
Refactored njs documentation.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
22 В отличие от njs, запущенном внутри nginx, |
87a0e2c73a25
Refactored njs documentation.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
23 в утилите недоступны объекты nginx |
2246
32ba43abf9cd
Renamed njs API, njs Changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2245
diff
changeset
|
24 (<link doc="reference.xml" id="http">HTTP</link> и |
32ba43abf9cd
Renamed njs API, njs Changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2245
diff
changeset
|
25 <link doc="reference.xml" id="stream">Stream</link>). |
2245
87a0e2c73a25
Refactored njs documentation.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
26 <example> |
2286
b9144a131eff
Corrected example in njs Command-line interface.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2246
diff
changeset
|
27 $ echo "2**3" | njs -q |
2245
87a0e2c73a25
Refactored njs documentation.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
28 8 |
87a0e2c73a25
Refactored njs documentation.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
29 |
87a0e2c73a25
Refactored njs documentation.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
30 $ njs |
2521
bb0a2fbdc886
Updated example in njs cli.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2286
diff
changeset
|
31 >> globalThis |
bb0a2fbdc886
Updated example in njs cli.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2286
diff
changeset
|
32 global { |
bb0a2fbdc886
Updated example in njs cli.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2286
diff
changeset
|
33 njs: njs { |
bb0a2fbdc886
Updated example in njs cli.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2286
diff
changeset
|
34 version: '0.3.9' |
bb0a2fbdc886
Updated example in njs cli.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2286
diff
changeset
|
35 }, |
bb0a2fbdc886
Updated example in njs cli.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2286
diff
changeset
|
36 global: [Circular], |
bb0a2fbdc886
Updated example in njs cli.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2286
diff
changeset
|
37 process: process { |
bb0a2fbdc886
Updated example in njs cli.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2286
diff
changeset
|
38 argv: [ |
bb0a2fbdc886
Updated example in njs cli.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2286
diff
changeset
|
39 '/usr/bin/njs' |
bb0a2fbdc886
Updated example in njs cli.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2286
diff
changeset
|
40 ], |
bb0a2fbdc886
Updated example in njs cli.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2286
diff
changeset
|
41 env: { |
bb0a2fbdc886
Updated example in njs cli.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2286
diff
changeset
|
42 PATH: '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', |
bb0a2fbdc886
Updated example in njs cli.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2286
diff
changeset
|
43 HOSTNAME: 'f777c149d4f8', |
bb0a2fbdc886
Updated example in njs cli.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2286
diff
changeset
|
44 TERM: 'xterm', |
bb0a2fbdc886
Updated example in njs cli.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2286
diff
changeset
|
45 NGINX_VERSION: '1.17.9', |
bb0a2fbdc886
Updated example in njs cli.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2286
diff
changeset
|
46 NJS_VERSION: '0.3.9', |
bb0a2fbdc886
Updated example in njs cli.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2286
diff
changeset
|
47 PKG_RELEASE: '1~buster', |
bb0a2fbdc886
Updated example in njs cli.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2286
diff
changeset
|
48 HOME: '/root' |
bb0a2fbdc886
Updated example in njs cli.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2286
diff
changeset
|
49 } |
bb0a2fbdc886
Updated example in njs cli.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2286
diff
changeset
|
50 }, |
bb0a2fbdc886
Updated example in njs cli.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2286
diff
changeset
|
51 console: { |
bb0a2fbdc886
Updated example in njs cli.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2286
diff
changeset
|
52 log: [Function: native], |
bb0a2fbdc886
Updated example in njs cli.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2286
diff
changeset
|
53 dump: [Function: native], |
bb0a2fbdc886
Updated example in njs cli.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2286
diff
changeset
|
54 time: [Function: native], |
bb0a2fbdc886
Updated example in njs cli.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2286
diff
changeset
|
55 timeEnd: [Function: native] |
bb0a2fbdc886
Updated example in njs cli.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2286
diff
changeset
|
56 }, |
bb0a2fbdc886
Updated example in njs cli.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2286
diff
changeset
|
57 print: [Function: native] |
2245
87a0e2c73a25
Refactored njs documentation.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
58 } |
87a0e2c73a25
Refactored njs documentation.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
59 >> |
87a0e2c73a25
Refactored njs documentation.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
60 </example> |
87a0e2c73a25
Refactored njs documentation.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
61 </para> |
87a0e2c73a25
Refactored njs documentation.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
62 |
87a0e2c73a25
Refactored njs documentation.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
63 </section> |
87a0e2c73a25
Refactored njs documentation.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
64 |
87a0e2c73a25
Refactored njs documentation.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
65 </article> |