Node.js v10.12.0 已发布,更新内容如下:
- assert
- The diff output is now a tiny bit improved by sorting object properties when inspecting the values that are compared with each other. #22788
- cli
- The options parser now normalizes
_
to-
in all multi-word command-line flags, e.g.--no_warnings
has the same effect as--no-warnings
. #23020 - Added bash completion for the
node
binary. To generate a bash completion script, runnode --completion-bash
. The output can be saved to a file which can be sourced to enable completion. #20713
- The options parser now normalizes
- crypto
- Added support for PEM-level encryption. #23151
- Added an API asymmetric key pair generation. The new methods
crypto.generateKeyPair
andcrypto.generateKeyPairSync
can be used to generate public and private key pairs. The API supports RSA, DSA and EC and a variety of key encodings (both PEM and DER). #22660
- fs
- Added a
recursive
option tofs.mkdir
andfs.mkdirSync
. If this option is set to true, non-existing parent folders will be automatically created. #21875
- Added a
- http2
- module
- Added
module.createRequireFromPath(filename)
. This new method can be used to create a custom require function that will resolve modules relative to the filename path. #19360
- Added
- process
- Added a
'multipleResolves'
process event that is emitted whenever aPromise
is attempted to be resolved multiple times, e.g. if theresolve
andreject
functions are both called in aPromise
executor. #22218
- Added a
- url
- Added
url.fileURLToPath(url)
andurl.pathToFileURL(path)
. These methods can be used to correctly convert between file: URLs and absolute paths. #22506
- Added
- util
- Added the
sorted
option toutil.inspect()
. If set totrue
, all properties of an object and Set and Map entries will be sorted in the returned string. If set to a function, it is used as a compare function. #22788 - The
util.instpect.custom
symbol is now defined in the global symbol registry asSymbol.for('nodejs.util.inspect.custom')
. #20857 - Added support for
BigInt
numbers inutil.format()
. #22097
- Added the
- V8 API
- A number of V8 C++ APIs have been marked as deprecated since they have been removed in the upstream repository. Replacement APIs are added where necessary. #23159
- Windows
- The Windows msi installer now provides an option to automatically install the tools required to build native modules. #22645
- Workers
- Added new collaborators:
- digitalinfinity – Hitesh Kanwathirtha
完整更新内容和下载地址请查阅发行说明。
转自 https://www.oschina.net/news/100725/nodejs-10-12-0-released