Mercurial > hg > nginx-site
diff xml/en/docs/stream/ngx_stream_js_module.xml @ 2901:9719a0184a67
Documented the js_preload_object directive.
author | Yaroslav Zhuravlev <yar@nginx.com> |
---|---|
date | Fri, 21 Oct 2022 12:19:07 +0100 |
parents | 986e1f930e3b |
children | 3cc6e38246b1 |
line wrap: on
line diff
--- a/xml/en/docs/stream/ngx_stream_js_module.xml +++ b/xml/en/docs/stream/ngx_stream_js_module.xml @@ -9,7 +9,7 @@ <module name="Module ngx_stream_js_module" link="/en/docs/stream/ngx_stream_js_module.html" lang="en" - rev="33"> + rev="34"> <section id="summary"> @@ -471,6 +471,34 @@ since <link doc="../njs/changes.xml" id= </directive> +<directive name="js_preload_object"> +<syntax><value>name.json</value> | +<value>name</value> from <value>file.json</value></syntax> +<default/> +<context>stream</context> +<context>server</context> +<appeared-in>0.7.8</appeared-in> + +<para> +Preloads an immutable object at configure time. +The <literal>name</literal> is used a name of the global variable +though which the object is available in njs code. +If the <literal>name</literal> is not specified, +the file name will be used instead. +<example> +js_preload_object map.json; +</example> +Here, the <literal>map</literal> is used as a name +while accessing the preloaded object. +</para> + +<para> +Several <literal>js_preload_object</literal> directives can be specified. +</para> + +</directive> + + <directive name="js_preread"> <syntax><value>function</value> | <value>module.function</value></syntax> <default/>