view xml/en/docs/njs/cli.xml @ 2246:32ba43abf9cd

Renamed njs API, njs Changes.
author Yaroslav Zhuravlev <yar@nginx.com>
date Mon, 24 Sep 2018 19:24:04 +0300
parents 87a0e2c73a25
children b9144a131eff
line wrap: on
line source

<?xml version="1.0"?>

<!--
  Copyright (C) Nginx, Inc.
  -->

<!DOCTYPE article SYSTEM "../../../../dtd/article.dtd">

<article name="Command-line interface"
        link="/en/docs/njs/cli.html"
        lang="en"
        rev="2">

<section>
<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 doc="install.xml" id="install_package">package</link>
or after building from the
<link doc="install.xml" id="install_sources">sources</link>.
Compared to njs running inside nginx,
nginx objects
(<link doc="reference.xml" id="http">HTTP</link> and
<link doc="reference.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>