Node v12.7.0 is out 🎉

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/

You Might Also Like

Leave a Reply