February 19, 2025

Subject: Bundling dependencies; keyword `using`; Intl.DurationFormat; vlt client; Deno npm module specifiers; Node v23.8.0; require(esm); Node.js loader framework; bundler plugins

Dear readers!

We moved the publication day of ECMAScript News from Tuesday to Wednesday – which works better with our schedules. Apologies for the sudden change and thanks for reading!

Axel and Jowe

Secure your JavaScript dependencies.

socket.dev Sponsor

Open source code makes up 90% of most codebases. Socket detects what traditional vulnerability scanners can’t, including 70+ indicators of open source supply chain risk like malware, typosquatting, hijacked packages, obfuscated code, privileged APIs, and more. Install our free GitHub app today to instantly enable protection on all updates and new dependencies added in PRs.

Bundling dependencies (and when not to do it)

e18e.dev @e18e@m.webtoo.ls

Clean room tests with JavaScript’s using keyword

blog.disintegrator.dev @disintegrator@mastodon.social

A little while ago the “Explicit Resource Management” proposal was promoted to stage 3 and with it the introduction of the using keyword. Support for this feature was then introduced into TypeScript 5.2. I love this feature and, almost instantly, it gave me the idea to incorporate it into my testing to cleanly encapsulate the process of creating test databases, mock servers and so on and then tearing them down to avoid conflicts, contentions and runaway resource usage.

Using Intl.DurationFormat for localized durations

www.raymondcamden.com @raymondcamden@mastodon.social

vlt client for managing packages: new GUI features

blog.vlt.sh github.com/ejkorol @vltpkg@fosstodon.org

Now recommended for Deno: npm: module specifiers

deno.com github.com/lambtron @deno_land@fosstodon.org

// Old recommendation:
import React from 'https://esm.sh/react@19';

// New recommendation:
import React from 'npm:react@19';
  • Interesting benefit: You can write stand-alone scripts that don’t need a config file to specify package versions.
  • As soon as a project has more than one file, you probably want to use an import map – mentioning the package version for each import seems tedious.

Node.js

Node v23.8.0 (current): URL Pattern API, zstd compression, named threads and more

nodejs.org github.com/targos @nodejs@social.lfx.dev

Highlights:
  • URL Pattern API: currently an import from node:url, available as a global in Node.js 24.
  • Support for the zstd compression algorithm
  • “Threads created by the Node.js process are now named to improve the debugging experience. Worker threads will use the name option that can be passed to the Worker constructor.”

require(esm) backported to Node.js 20, paving the way for ESM-only packages

socket.dev @sarahgooding@fosstodon.org @SocketSecurity@fosstodon.org

“The long-standing divide between CommonJS (CJS) and ECMAScript Modules (ESM) in the Node.js ecosystem just took a major step toward resolution. Thanks to the incredible efforts of Joyee Cheung, require(esm) has been backported to Node.js 20.”

“This change means that when Node.js 18 reaches end-of-life (EOL) in April 2025, library maintainers can finally drop their CJS builds and ship ESM-only packages with confidence.”

Interesting npm packages

unloader: Node.js loader framework with a Rollup-like interface

github.com @sxzz@webtoo.ls

Quote: “unloader is designed to be a general-purpose loader, which can be used to develop various loaders, such as Oxc loader, TypeScript loader, etc.”

Unplugin: unified plugin system for Vite, Rollup, Webpack, esbuild, Rolldown, and more

unplugin.unjs.io github.com/unjs

This email was sent to {{ email | default }}. You can unsubscribe from this list here or update your preferences.