Mercurial > hg > nginx-site
comparison xml/en/docs/njs/reference.xml @ 2666:68c0566a375f
Documented njs global object in njs Refernce.
author | Yaroslav Zhuravlev <yar@nginx.com> |
---|---|
date | Thu, 04 Mar 2021 16:38:00 +0000 |
parents | 529114f1108a |
children | 2085eb315672 |
comparison
equal
deleted
inserted
replaced
2665:529114f1108a | 2666:68c0566a375f |
---|---|
7 <!DOCTYPE article SYSTEM "../../../../dtd/article.dtd"> | 7 <!DOCTYPE article SYSTEM "../../../../dtd/article.dtd"> |
8 | 8 |
9 <article name="Reference" | 9 <article name="Reference" |
10 link="/en/docs/njs/reference.html" | 10 link="/en/docs/njs/reference.html" |
11 lang="en" | 11 lang="en" |
12 rev="63"> | 12 rev="64"> |
13 | 13 |
14 <section id="summary"> | 14 <section id="summary"> |
15 | 15 |
16 <para> | 16 <para> |
17 <link doc="index.xml">njs</link> provides objects, methods and properties | 17 <link doc="index.xml">njs</link> provides objects, methods and properties |
814 | 814 |
815 | 815 |
816 <section id="core_global" name="Global"> | 816 <section id="core_global" name="Global"> |
817 | 817 |
818 | 818 |
819 <section id="njs" name="njs"> | |
820 | |
821 <para> | |
822 The <literal>njs</literal> object is a global object | |
823 that represents the current VM instance | |
824 (since <link doc="changes.xml" id="njs0.2.0">0.2.0</link>). | |
825 </para> | |
826 | |
827 <para> | |
828 <list type="tag"> | |
829 | |
830 <tag-name id="njs_version"><literal>njs.version</literal></tag-name> | |
831 <tag-desc> | |
832 Returns a string with the current version of njs | |
833 (for example, “0.5.2”). | |
834 </tag-desc> | |
835 | |
836 <tag-name id="njs_dump"><literal>njs.dump(<value>value</value>)</literal></tag-name> | |
837 <tag-desc> | |
838 Returns the pretty-print string representation for a value. | |
839 </tag-desc> | |
840 | |
841 <tag-name id="njs_on"><literal>njs.on</literal></tag-name> | |
842 <tag-desc> | |
843 Registers a callback for the specified VM event | |
844 (since <link doc="changes.xml" id="njs0.5.2">0.5.2</link>). | |
845 An event may be one of the following strings: | |
846 <list type="tag"> | |
847 | |
848 <tag-name><literal>exit</literal></tag-name> | |
849 <tag-desc> | |
850 is called before the VM is destroyed. | |
851 The callback is called without arguments. | |
852 </tag-desc> | |
853 | |
854 </list> | |
855 </tag-desc> | |
856 | |
857 </list> | |
858 </para> | |
859 | |
860 </section> | |
861 | |
862 | |
819 <section id="process" name="Process"> | 863 <section id="process" name="Process"> |
820 | 864 |
821 <para> | 865 <para> |
822 The <literal>process</literal> object is a global object | 866 The <literal>process</literal> object is a global object |
823 that provides information about the current process | 867 that provides information about the current process |