comparison 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
comparison
equal deleted inserted replaced
2900:e4a87f3a05d8 2901:9719a0184a67
7 <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd"> 7 <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd">
8 8
9 <module name="Module ngx_stream_js_module" 9 <module name="Module ngx_stream_js_module"
10 link="/en/docs/stream/ngx_stream_js_module.html" 10 link="/en/docs/stream/ngx_stream_js_module.html"
11 lang="en" 11 lang="en"
12 rev="33"> 12 rev="34">
13 13
14 <section id="summary"> 14 <section id="summary">
15 15
16 <para> 16 <para>
17 The <literal>ngx_stream_js_module</literal> module is used to implement 17 The <literal>ngx_stream_js_module</literal> module is used to implement
464 <note> 464 <note>
465 The directive can be specified on the 465 The directive can be specified on the
466 <literal>server</literal> level 466 <literal>server</literal> level
467 since <link doc="../njs/changes.xml" id="njs0.7.7">0.7.7</link>. 467 since <link doc="../njs/changes.xml" id="njs0.7.7">0.7.7</link>.
468 </note> 468 </note>
469 </para>
470
471 </directive>
472
473
474 <directive name="js_preload_object">
475 <syntax><value>name.json</value> |
476 <value>name</value> from <value>file.json</value></syntax>
477 <default/>
478 <context>stream</context>
479 <context>server</context>
480 <appeared-in>0.7.8</appeared-in>
481
482 <para>
483 Preloads an immutable object at configure time.
484 The <literal>name</literal> is used a name of the global variable
485 though which the object is available in njs code.
486 If the <literal>name</literal> is not specified,
487 the file name will be used instead.
488 <example>
489 js_preload_object map.json;
490 </example>
491 Here, the <literal>map</literal> is used as a name
492 while accessing the preloaded object.
493 </para>
494
495 <para>
496 Several <literal>js_preload_object</literal> directives can be specified.
469 </para> 497 </para>
470 498
471 </directive> 499 </directive>
472 500
473 501