Deno 1.26 improves Node.js compatibility, npm support

Latest update to the alternative TypeScript/JavaScript runtime also brings bug fixes and performance boosts.

Neon sign > handshake / deal / agreement / partnership / team / merger
Charles Deluvio (CC0)

Deno 1.26, the latest version of the TypeScript/JavaScript runtime that strives to improve on Node.js, emphasizes Node.js compatibility, among other improvements.

Deno 1.26 was unveiled September 29. The update includes implementations for several previously unsupported APIs in the Node.js compatibility layer, according to release notes. In addition, the compatibility layer’s test suite was updated for compatibility with Node.js v18.8.0, in preparation for Node.js 18 entering Long Term Support (LTS) status next month.

Further, Deno 1.26 updates the Node.js streams implementation to use the readable-stream@4.1.0 NPM module, allowing Deno to better keep up with breaking changes and new features. Within this compatibility layer, the stream and stream/promises modules are now implemented via readable_stream. This refactor also introduces new APIs including Writable.toWeb() and Readable.toWeb(), which are used to convert Node.js streams to web streams. In addition, fs.ReadStream and fs.WriteStream have been updated to improve compatibility with implementations in Node.js.

Developers can upgrade to Deno 1.26 by running deno upgrade. Other instructions for installing Deno can be found at deno.land.

Also in Deno 1.26:

  • Bugs have been fixed related to NPM specifiers. Support for NPM modules remains experimental and requires the –unstable flag.
  • Bugs such as spurious hangs on Windows have been fixed in the Deno.serve() API, which provides a fast HTTP server.
  • Support has been added for a Cache web API, to cache request/response objects, helpful when dynamically generating responses.
  • A new permission flag, --allow-sys, guards access to APIs that provide information about a user’s operating system.
  • Deno 1.26 ships with TypeScript 4.8.

The developers of Deno said ongoing performance improvements have been made as part of an initiative to find bottlenecks and reduce latency and processing overhead. The team also made developer experience improvements, such as an overhaul of the search capability on deno.land, improving the ability to search symbols across built-in APIs, the Deno standard library, and third-party modules. Other improvements are planned such as auto-linking between symbols within documentation.

Copyright © 2022 IDG Communications, Inc.