Mercurial > hg > nginx-site
diff xml/en/docs/njs_about.xml @ 2174:3b782a679237
Mentioned njs CLI in "About njs".
author | Yaroslav Zhuravlev <yar@nginx.com> |
---|---|
date | Tue, 05 Jun 2018 17:17:24 +0300 |
parents | af5751930f95 |
children | cd4889fdcfa4 |
line wrap: on
line diff
--- a/xml/en/docs/njs_about.xml Wed Jun 06 15:03:48 2018 +0300 +++ b/xml/en/docs/njs_about.xml Tue Jun 05 17:17:24 2018 +0300 @@ -9,7 +9,7 @@ <article name="About njs" link="/en/docs/njs_about.html" lang="en" - rev="18"> + rev="19"> <section id="summary"> @@ -270,6 +270,8 @@ 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 <link id="cli">utility</link>. </para> @@ -316,8 +318,49 @@ </example> </para> +<para> +To build only njs command-line <link id="cli">utility</link>, run +<literal>./configure</literal> and <literal>make njs</literal> commands +from njs root directory. +The utility is available as <literal>./build/njs</literal>. +</para> + </section> </section> + +<section id="cli" name="Command-line interface"> + +<para> +njs scripts development and debugging can be performed +from the command-line. +The command-line utility is available after the installation of +the Linux <link id="install_package">package</link> +or after building from the <link id="install_sources">sources</link>. +Compared to njs running inside nginx, +nginx objects +(<link doc="njs/njs_api.xml" id="http">HTTP</link> and +<link doc="njs/njs_api.xml" id="stream">Stream</link>) +are not available in the utility. +<example> +$ echo "2**3" | njs - +8 + +$ njs +>> var o = {a:[]} +undefined + +>> JSON.stringify(o, undefined,1) +{ + "a": [ + + ] +} +>> +</example> +</para> + +</section> + </article>