The Node JS team has a new release v12.7. This new version has new features and improvements.
response.writableState.finished
Adding writableFinished to Http Response by adding a new getter to duplex stream to replace the property `this.writableState.finished` of the object that inherited duplex.
inspector.waitForDebugger()Ā
This method blocks current node process until a client sends.
It can be useful when we need to reportĀ inspector.url()
Ā before
waiting for connection:
inspector.open(0, undefined, false);
fs.writeFileSync(someFileName, inspector.url());
inspector.waitForDebugger();
pkg-exports
This implements the package.json “exports” proposal (https://github.com/jkrems/proposal-pkg-exports/) with the following features:
- WhenĀ
"exports"
Ā are defined for a package ({ "exports": { "./x": "./x.js" }
), resolving that packageĀimport 'pkg/x'
, will resolve the exports path (/path/to/pkg/x.js
). - When a subpath does not matchĀ
"exports"
, an error is thrown (see test case). - Support forĀ
"exports": false
Ā to indicate a package has no exports at all. - Support for folder exports (
{ "./folder/": "./other-folder/" }
).
This reflects the consensus from this week’s modules working group to move forward withĀ exports
Ā support in core.
Items to be addressed before this feature is considered “fully done”:
- SupportĀ
exports
Ā in theĀrequire
Ā loader. - Consider key / target validations (if any) and provide error messages where appropriate.
- Make call on support for differential exports (array syntax in import maps).
- Make call on support for package-internal entries (e.g. anĀ
imports
Ā field inĀpackage.json
).
The working group’s recommendation was to address these items as follow-ups to keep the changes (and discussions) focussed on one thing at a time.
See:Ā jkrems/proposal-pkg-exports#36
Source: https://nodejs.org/de/blog/release/v12.7.0/