Skip to content

Commit 05bbbaa

Browse files
update reference.json (#501)
Co-authored-by: ryepup <40441+ryepup@users.noreply.github.com>
1 parent 734afb3 commit 05bbbaa

3 files changed

Lines changed: 36 additions & 4 deletions

File tree

reference-lib/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

reference-lib/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nginx/reference-lib",
3-
"version": "1.1.25",
3+
"version": "1.1.26",
44
"description": "",
55
"main": "dist/index.js",
66
"type": "module",

reference-lib/src/reference.json

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5518,6 +5518,22 @@
55185518
"description_md": "Specifies a file that implements location and variable handlers in njs:\n```\nnginx.conf:\njs_include http.js;\nlocation /version {\n js_content version;\n}\n\nhttp.js:\nfunction version(r) {\n r.return(200, njs.version);\n}\n```\n\nThe directive was made obsolete in version\n[0.4.0](https://nginx.org/en/docs/njs/changes.html#njs0.4.0)\nand was removed in version\n[0.7.1](https://nginx.org/en/docs/njs/changes.html#njs0.7.1).\nThe [`js_import`](https://nginx.org/en/docs/http/ngx_http_js_module.html#js_import) directive should be used instead.",
55195519
"description_html": "<p>Specifies a file that implements location and variable handlers in njs:</p>\n\n<pre><code>nginx.conf:\njs_include http.js;\nlocation /version {\n js_content version;\n}\n\nhttp.js:\nfunction version(r) {\n r.return(200, njs.version);\n}\n</code></pre>\n\n<p>The directive was made obsolete in version\n<a href=\"https://nginx.org/en/docs/njs/changes.html#njs0.4.0\" target=\"_blank\">0.4.0</a>\nand was removed in version\n<a href=\"https://nginx.org/en/docs/njs/changes.html#njs0.7.1\" target=\"_blank\">0.7.1</a>.\nThe <a href=\"https://nginx.org/en/docs/http/ngx_http_js_module.html#js_import\" target=\"_blank\"><code>js_import</code></a> directive should be used instead.</p>\n"
55205520
},
5521+
{
5522+
"name": "js_load_http_native_module",
5523+
"default": "",
5524+
"contexts": [
5525+
"main"
5526+
],
5527+
"syntax_md": [
5528+
"*`path`* [`as` *`name`*]"
5529+
],
5530+
"syntax_html": [
5531+
"<p><em><code>path</code></em> [<code>as</code> <em><code>name</code></em>]</p>\n"
5532+
],
5533+
"isBlock": false,
5534+
"description_md": "Loads a [native module](https://nginx.org/en/docs/njs/native_modules.html)\n(shared library) for use in HTTP JavaScript code.\nThe directive is\n[QuickJS](https://nginx.org/en/docs/njs/engine.html#quickjs_engine)-only\nand is not available when using the njs built-in JavaScript engine.\n\nThe *`path`* parameter\nspecifies the absolute path to the shared library file.\nThe optional `as` *`name`* parameter\nprovides an alias name for importing the module in JavaScript code.\nIf not specified, the module can be imported using its filename.\n\nExample:\n```\njs_load_http_native_module /path/to/mylib.so;\njs_load_http_native_module /path/to/other.so as myalias;\n\nhttp {\n js_import main.js;\n # ... rest of http configuration\n}\n```\nIn JavaScript code:\n```\n// Import by filename\nimport * as mylib from 'mylib.so';\n\n// Import by alias\nimport * as myalias from 'myalias';\n\n// Use exported functions\nlet result = mylib.add(5, 10);\n```\n\n> For security reasons, this directive is only allowed\n> in the `main` configuration context.\n> Native modules run with full process privileges;\n> use absolute paths and ensure proper code review.",
5535+
"description_html": "<p>Loads a <a href=\"https://nginx.org/en/docs/njs/native_modules.html\" target=\"_blank\">native module</a>\n(shared library) for use in HTTP JavaScript code.\nThe directive is\n<a href=\"https://nginx.org/en/docs/njs/engine.html#quickjs_engine\" target=\"_blank\">QuickJS</a>-only\nand is not available when using the njs built-in JavaScript engine.</p>\n\n<p>The <em><code>path</code></em> parameter\nspecifies the absolute path to the shared library file.\nThe optional <code>as</code> <em><code>name</code></em> parameter\nprovides an alias name for importing the module in JavaScript code.\nIf not specified, the module can be imported using its filename.</p>\n\n<p>Example:</p>\n\n<pre><code>js_load_http_native_module /path/to/mylib.so;\njs_load_http_native_module /path/to/other.so as myalias;\n\nhttp {\n js_import main.js;\n # ... rest of http configuration\n}\n</code></pre>\n\n<p>In JavaScript code:</p>\n\n<pre><code>// Import by filename\nimport * as mylib from 'mylib.so';\n\n// Import by alias\nimport * as myalias from 'myalias';\n\n// Use exported functions\nlet result = mylib.add(5, 10);\n</code></pre>\n\n<blockquote>\n<p>For security reasons, this directive is only allowed\nin the <code>main</code> configuration context.\nNative modules run with full process privileges;\nuse absolute paths and ensure proper code review.</p>\n</blockquote>\n"
5536+
},
55215537
{
55225538
"name": "js_path",
55235539
"default": "",
@@ -15716,6 +15732,22 @@
1571615732
"description_md": "Specifies a file that implements server and variable handlers in njs:\n```\nnginx.conf:\njs_include stream.js;\njs_set $js_addr address;\nserver {\n listen 127.0.0.1:12345;\n return $js_addr;\n}\n\nstream.js:\nfunction address(s) {\n return s.remoteAddress;\n}\n```\n\nThe directive was made obsolete in version\n[0.4.0](https://nginx.org/en/docs/njs/changes.html#njs0.4.0)\nand was removed in version\n[0.7.1](https://nginx.org/en/docs/njs/changes.html#njs0.7.1).\nThe [`js_import`](https://nginx.org/en/docs/stream/ngx_stream_js_module.html#js_import) directive should be used instead.",
1571715733
"description_html": "<p>Specifies a file that implements server and variable handlers in njs:</p>\n\n<pre><code>nginx.conf:\njs_include stream.js;\njs_set $js_addr address;\nserver {\n listen 127.0.0.1:12345;\n return $js_addr;\n}\n\nstream.js:\nfunction address(s) {\n return s.remoteAddress;\n}\n</code></pre>\n\n<p>The directive was made obsolete in version\n<a href=\"https://nginx.org/en/docs/njs/changes.html#njs0.4.0\" target=\"_blank\">0.4.0</a>\nand was removed in version\n<a href=\"https://nginx.org/en/docs/njs/changes.html#njs0.7.1\" target=\"_blank\">0.7.1</a>.\nThe <a href=\"https://nginx.org/en/docs/stream/ngx_stream_js_module.html#js_import\" target=\"_blank\"><code>js_import</code></a> directive should be used instead.</p>\n"
1571815734
},
15735+
{
15736+
"name": "js_load_stream_native_module",
15737+
"default": "",
15738+
"contexts": [
15739+
"main"
15740+
],
15741+
"syntax_md": [
15742+
"*`path`* [`as` *`name`*]"
15743+
],
15744+
"syntax_html": [
15745+
"<p><em><code>path</code></em> [<code>as</code> <em><code>name</code></em>]</p>\n"
15746+
],
15747+
"isBlock": false,
15748+
"description_md": "Loads a [native module](https://nginx.org/en/docs/njs/native_modules.html)\n(shared library) for use in Stream JavaScript code.\nThe directive is\n[QuickJS](https://nginx.org/en/docs/njs/engine.html#quickjs_engine)-only\nand is not available when using the njs built-in JavaScript engine.\n\nThe *`path`* parameter\nspecifies the absolute path to the shared library file.\nThe optional `as` *`name`* parameter\nprovides an alias name for importing the module in JavaScript code.\nIf not specified, the module can be imported using its filename.\n\nExample:\n```\njs_load_stream_native_module /path/to/mylib.so;\njs_load_stream_native_module /path/to/other.so as myalias;\n\nstream {\n js_import main.js;\n # ... rest of stream configuration\n}\n```\nIn JavaScript code:\n```\n// Import by filename\nimport * as mylib from 'mylib.so';\n\n// Import by alias\nimport * as myalias from 'myalias';\n\n// Use exported functions\nlet result = mylib.add(5, 10);\n```\n\n> For security reasons, this directive is only allowed\n> in the `main` configuration context.\n> Native modules run with full process privileges;\n> use absolute paths and ensure proper code review.",
15749+
"description_html": "<p>Loads a <a href=\"https://nginx.org/en/docs/njs/native_modules.html\" target=\"_blank\">native module</a>\n(shared library) for use in Stream JavaScript code.\nThe directive is\n<a href=\"https://nginx.org/en/docs/njs/engine.html#quickjs_engine\" target=\"_blank\">QuickJS</a>-only\nand is not available when using the njs built-in JavaScript engine.</p>\n\n<p>The <em><code>path</code></em> parameter\nspecifies the absolute path to the shared library file.\nThe optional <code>as</code> <em><code>name</code></em> parameter\nprovides an alias name for importing the module in JavaScript code.\nIf not specified, the module can be imported using its filename.</p>\n\n<p>Example:</p>\n\n<pre><code>js_load_stream_native_module /path/to/mylib.so;\njs_load_stream_native_module /path/to/other.so as myalias;\n\nstream {\n js_import main.js;\n # ... rest of stream configuration\n}\n</code></pre>\n\n<p>In JavaScript code:</p>\n\n<pre><code>// Import by filename\nimport * as mylib from 'mylib.so';\n\n// Import by alias\nimport * as myalias from 'myalias';\n\n// Use exported functions\nlet result = mylib.add(5, 10);\n</code></pre>\n\n<blockquote>\n<p>For security reasons, this directive is only allowed\nin the <code>main</code> configuration context.\nNative modules run with full process privileges;\nuse absolute paths and ensure proper code review.</p>\n</blockquote>\n"
15750+
},
1571915751
{
1572015752
"name": "js_path",
1572115753
"default": "",
@@ -18216,5 +18248,5 @@
1821618248
]
1821718249
}
1821818250
],
18219-
"version": "https://github.com/nginx/nginx.org/commit/cc7bceb22509727fe8eb25c6def1b01e33671fb7"
18251+
"version": "https://github.com/nginx/nginx.org/commit/ff3d35c074a5d8eb4edfd531c9d6ba14af4008e4"
1822018252
}

0 commit comments

Comments
 (0)