# HG changeset patch # User Yaroslav Zhuravlev # Date 1528208244 -10800 # Node ID 3b782a679237c072b1f7c6071cf96570b968840a # Parent 434c1961f5ed4f502996376319335f5c9ab2d110 Mentioned njs CLI in "About njs". diff --git a/xml/en/docs/njs_about.xml b/xml/en/docs/njs_about.xml --- a/xml/en/docs/njs_about.xml +++ b/xml/en/docs/njs_about.xml @@ -9,7 +9,7 @@
+ rev="19">
@@ -270,6 +270,8 @@ njs is available in two modules: Both modules are not built by default, they should be either compiled from the sources or installed as a Linux package. +In addition, the Linux package provides +njs command-line utility. @@ -316,8 +318,49 @@ The modules can also be built as + +To build only njs command-line utility, run +./configure and make njs commands +from njs root directory. +The utility is available as ./build/njs. + +
+ +
+ + +njs scripts development and debugging can be performed +from the command-line. +The command-line utility is available after the installation of +the Linux package +or after building from the sources. +Compared to njs running inside nginx, +nginx objects +(HTTP and +Stream) +are not available in the utility. + +$ echo "2**3" | njs - +8 + +$ njs +>> var o = {a:[]} +undefined + +>> JSON.stringify(o, undefined,1) +{ + "a": [ + + ] +} +>> + + + +
+
diff --git a/xml/ru/docs/njs_about.xml b/xml/ru/docs/njs_about.xml --- a/xml/ru/docs/njs_about.xml +++ b/xml/ru/docs/njs_about.xml @@ -9,7 +9,7 @@
+ rev="19">
@@ -269,6 +269,8 @@ njs доступен в двух модулях: По умолчанию модули не собираются их необходимо собрать из исходного кода или установить из отдельного пакета Linux. +Кроме того, в пакете Linux предоставляется +утилита командной строки njs. @@ -316,6 +318,47 @@ hg clone http://hg.nginx.org/njs + +Чтобы собрать только утилиту командной строки njs +необходимо запустить +команды ./configure и make njs +из корневого каталога. +Утилита доступна как ./build/njs. + + +
+ + +
+ + +Создание и отладка njs-скриптов может осуществляться +в командной строке. +Утилита командной строки доступна после установки +пакета Linux +или после сборки из исходных файлов. +В отличие от njs, запущенном внутри nginx, +в утилите недоступны объекты nginx +(HTTP и +Stream). + +$ echo "2**3" | njs - +8 + +$ njs +>> var o = {a:[]} +undefined + +>> JSON.stringify(o, undefined,1) +{ + "a": [ + + ] +} +>> + + +