[nginx-announce] njs-0.3.0

Dmitry Volyntsev xeioex at nginx.com
Tue Mar 26 16:29:25 UTC 2019


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

This release proceeds to extend the coverage of ECMAScript
specifications and modules functionality.

- Added initial ES6 modules support:
: // module.js
: function sum(a, b) {return a + b}
: export default {sum};
: // shell
: > import m from 'module.js'
: undefined
: > m.sum(3, 4)
: 7

You can learn more about njs:

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

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.0                                       26 Mar 2019

     nginx modules:

     *) Feature: added js_path directive.

     *) Change: returning undefined value instead of empty strings
        for absent properties in the following objects: r.args,
        r.headersIn, r.headersOut, r.variables, s.variables.

     *) Change: returning undefined value instead of throwing an
        exception for r.requestBody when request body is unavailable.

     *) Bugfix: fixed crash while iterating over r.args when a value is
        absent in a key-value pair.


     *) Feature: added initial ES6 modules support. Default import and
        default export statements are supported.
        Thanks to 洪志道 (Hong Zhi Dao).

     *) Feature: added Object.prototype.propertyIsEnumerable().

     *) Feature: reporting file name and function name in disassembler

     *) Bugfix: fixed function redeclarations in interactive shell.
        Thanks to 洪志道 (Hong Zhi Dao).

     *) Bugfix: fixed RegExp literals parsing.

     *) Bugfix: fixed setting length of UTF8 string in fs.readFileSync().

     *) Bugfix: fixed nxt_file_dirname() for paths with no dir component.

More information about the nginx-announce mailing list