Added "js_load_http_native_module" and "js_load_stream_native_module"
main nginx.conf level directives. The directives load a dynamic
library. For security reason it is only allowed in the main context.
Later, JS code may import modules loaded with these directives
with standard import syntax.
example.conf:
...
js_load_http_native_module /path/to/lib.so;
js_load_http_native_module /path/to/lib2.so as lib2;
http {
js_import main.js;
...
main.js:
import * as lib from 'lib.so';
import * as lib2 from 'lib2';
...
See quickjs.h for the complete QuickJS API reference and
nginx/t/js_native_module.t for a working example.