Welcome! Log In Create A New Profile


[nginx-announce] njs-0.3.9

Posted by Dmitry Volyntsev 
Dmitry Volyntsev
[nginx-announce] njs-0.3.9
March 03, 2020 12:42PM

I'm glad to announce a new release of NGINX JavaScript module (njs).

This release proceeds to extend the coverage of ECMAScript

Notable new features:
- Promises API for "fs" module.
: var fs = require('fs').promises;
: fs.readFile('/file/path').then(data => r.return(200, data));

- detached r.subrequest(): Running a subrequest in the log phase
: nginx.conf:
: ...
: js_set $js_log js_log;
: ...
: log_format subrequest_log "...$js_log";
: access_log /log/path.log subrequest_log;
: nginx.js:
: function js_log(r) {
: r.subrequest('/_log', {detached:true});
: return '';
: }

You can learn more about njs:

- Overview and introduction: http://nginx.org/en/docs/njs/
- Presentation: https://youtu.be/Jc_L6UffFOs
- Using node modules with njs:

Feel free to try it and give us feedback on:

- Github: https://github.com/nginx/njs/issues
- Mailing list: http://mailman.nginx.org/mailman/listinfo/nginx-devel

Changes with njs 0.3.9 03 Mar 2020

nginx modules:

*) Feature: added detached mode for r.subrequest(). Responses to
detached subrequests are ignored. Unlike ordinary subrequests,
a detached subrequest can be created inside a variable handler.


*) Feature: added promises API for "fs" module.
Thanks to Artem S. Povalyukhin.

*) Feature: extended "fs" module. Added access(), symlink(), unlink(),
realpath() and friends.
Thanks to Artem S. Povalyukhin.

*) Improvement: introduced memory-efficient ordinary arrays.

*) Improvement: lexer refactoring.

*) Bugfix: fixed matching of native functions in backtraces.

*) Bugfix: fixed callback invocations in "fs" module.
Thanks to Artem S. Povalyukhin.

*) Bugfix: fixed Object.getOwnPropertySymbols().

*) Bugfix: fixed heap-buffer-overflow in njs_json_append_string().

*) Bugfix: fixed encodeURI() and decodeURI() according to
the specification.

*) Bugfix: fixed Number.prototype.toPrecision().

*) Bugfix: fixed handling of space argument in JSON.stringify().

*) Bugfix: fixed JSON.stringify() with Number() and String() objects.

*) Bugfix: fixed Unicode Escaping in JSON.stringify() according
to specification.

*) Bugfix: fixed non-native module importing.
Thanks to 洪志道 (Hong Zhi Dao).

*) Bugfix: fixed njs.dump() with the Date() instance in a container.
nginx-announce mailing list
Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 112
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready