Node.js® is a free, open-source, cross-platform JavaScript runtime environment that lets developers create servers, web apps, command line tools and scripts.
Published By From Node.js News · 1 min read
ReleaseNode.js 22.10.0 (Current)
This release introduces a "module-sync" exports condition that's enabled when require(esm) is enabled, so packages can supply a synchronous ES module to the Node.js module loader, no matter if it's being required or imported. This is similar to the "module" condition that bundlers have been using to support require(esm) in Node.js, and allows dual-package authors to opt into ESM-first only on newer versions of Node.js that supports require(esm) to avoid the dual-package hazard.
Or if the package is only meant to be run on Node.js and wants to fallback to CJS on older versions that don't have require(esm) :
For package authors : this only serves as a feature-detection mechanism for packages that wish to support both CJS and ESM…
This is an excerpt. The full article is published by Node.js News.
This CLI flag runs a specified command from a package.json's "scripts" object. For the following package.json: {
"scripts": {
"test": "node --test-reporter junit --test ./test"
}
}JSON
You can run node --run test and that would start the test suite. Contributed by Yagiz Nizipli in #53763.
This release introduces a "module-sync" exports condition that's enabled when
require(esm) is enabled, so packages can supply a synchronous ES module to the
Node.js module loader, no matter if it's being required or imported. This is
similar to the "module" condition that bundlers have been using to support
require(esm) in Node.js, and allows dual-package authors to opt into ESM-first
only on newer versions of Node.js that supports require(esm) t
General
This release introduces a "module-sync" exports condition that's enabled when require(esm) is enabled, so packages can supply a synchronous ES module to the Node.js module loader, no matter if it's being required or imported. This is similar to the "module" condition that bundlers have been using to support require(esm) in Node.js, and allows dual-package authors to opt into ESM-first only on newer versions of Node.js that supports require(esm) to avoid the dual-package hazard.