# HG changeset patch # User Yaroslav Zhuravlev # Date 1583250330 0 # Node ID 8ad2ea80e0c2aa609251083d92f11688058cb8ee # Parent feb8b843e482ed0b0ae8cc85276281830de6e562 njs-0.3.9 diff -r feb8b843e482 -r 8ad2ea80e0c2 xml/en/docs/njs/changes.xml --- a/xml/en/docs/njs/changes.xml Tue Mar 03 18:11:05 2020 +0300 +++ b/xml/en/docs/njs/changes.xml Tue Mar 03 15:45:30 2020 +0000 @@ -9,9 +9,178 @@
+
+ + +Release Date: +03 March 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. + + + + + + + +Core: + + + + +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. + + + + + + +
+ +
@@ -698,7 +867,7 @@ Feature: added -fs.renameSync(). +fs.renameSync(). diff -r feb8b843e482 -r 8ad2ea80e0c2 xml/en/docs/njs/compatibility.xml --- a/xml/en/docs/njs/compatibility.xml Tue Mar 03 18:11:05 2020 +0300 +++ b/xml/en/docs/njs/compatibility.xml Tue Mar 03 15:45:30 2020 +0000 @@ -9,7 +9,7 @@
@@ -618,14 +618,27 @@ File system methods: +fs.accessSync +(0.3.9), fs.appendFileSync, fs.readFileSync, -fs.renameSync +fs.realpathSync +(0.3.9), +fs.renameSync (0.3.4), +fs.symlinkSync +(0.3.9), +fs.unlinkSync +(0.3.9), fs.writeFileSync +fs.promises API (0.3.9), +asynchronous version of file system methods. + + + Crypto methods (0.2.0): crypto.createHash, crypto.createHmac diff -r feb8b843e482 -r 8ad2ea80e0c2 xml/en/docs/njs/reference.xml --- a/xml/en/docs/njs/reference.xml Tue Mar 03 18:11:05 2020 +0300 +++ b/xml/en/docs/njs/reference.xml Tue Mar 03 15:45:30 2020 +0000 @@ -9,7 +9,7 @@
+ rev="36">
@@ -221,6 +221,16 @@ HTTP method, by default the GET method is used +detached + +boolean flag (0.3.9), +if true, the created subrequest is a detached subrequest. +Responses to detached subrequests are ignored. +Unlike ordinary subrequests, a detached subrequest +can be created inside a variable handler. +The detached flag and callback argument are mutually exclusive. + + @@ -1162,9 +1172,49 @@ The File System module provides operations with files. + + + The module object is returned by require('fs'). +Since (0.3.9), +promissified versions of methods described below are available through +require('fs').promises object: + +> var fs = require('fs').promises; +undefined +> fs.readFile("/file/path").then((data)=>console.log(data)) +<file data> + +accessSync(path[, +mode]) + +Synchronously tests permissions for a file or directory +specified in the path +(0.3.9). +If the check fails, an error will be returned, +otherwise, the method will return undefined. + + +mode + +by default is fs.constants.F_OK. +The mode argument is an optional integer +that specifies the accessibility checks to be performed. + +try { + fs.accessSync('/file/path', fs.constants.R_OK | fs.constants.W_OK); + console.log('has access'); +} catch (e) { + console.log('no access');) +} + + + + + + appendFileSync(filename, data[, options]) @@ -1225,6 +1275,18 @@ +realpathSync(path[, +options]) + +Synchronously computes the canonical pathname by resolving +., .. and symbolic links using +realpath(3) +The options argument can be a string specifying an encoding, +or an object with an encoding property specifying the character encoding +to use for the path passed to the callback +(0.3.9). + + writeFileSync(filename, data[, options]) @@ -1256,7 +1318,7 @@ -renameSync(oldPath, +renameSync(oldPath, newPath) Synchronously changes the name or location of a file from @@ -1270,10 +1332,62 @@ +symlinkSync(target, +path) + +Synchronously creates the link called path +pointing to target using +symlink(2) +(0.3.9). +Relative targets are relative to the link’s parent directory. + + +unlinkSync(path) + +Synchronously unlinks a file by path +(0.3.9). + + +
+ + +The access() method +can accept the following flags. +These flags are exported by fs.constants: + + + + +F_OK—indicates that the file +is visible to the calling process, +used by default if no mode is specified + + + +R_OK—indicates that the file can be +read by the calling process + + + +W_OK—indicates that the file can be +written by the calling process + + + +X_OK—indicates that the file can be +executed by the calling process + + + + + +
+ +
diff -r feb8b843e482 -r 8ad2ea80e0c2 xml/index.xml --- a/xml/index.xml Tue Mar 03 18:11:05 2020 +0300 +++ b/xml/index.xml Tue Mar 03 15:45:30 2020 +0000 @@ -9,6 +9,16 @@ +njs-0.3.9 +version has been +released, +featuring detached mode for +r.subrequest(). + + + + + nginx-1.17.9 mainline version has been released. diff -r feb8b843e482 -r 8ad2ea80e0c2 xml/ru/docs/njs/compatibility.xml --- a/xml/ru/docs/njs/compatibility.xml Tue Mar 03 18:11:05 2020 +0300 +++ b/xml/ru/docs/njs/compatibility.xml Tue Mar 03 15:45:30 2020 +0000 @@ -9,7 +9,7 @@
@@ -619,14 +619,27 @@ Методы File system: +fs.accessSync +(0.3.9), fs.appendFileSync, fs.readFileSync, -fs.renameSync +fs.realpathSync +(0.3.9), +fs.renameSync (0.3.4), +fs.symlinkSync +(0.3.9), +fs.unlinkSync +(0.3.9), fs.writeFileSync +fs.promises API (0.3.9), +асинхронная версия файловых методов file system. + + + Методы Crypto (0.2.0): crypto.createHash, crypto.createHmac