Deno 1.31: Enhanced Package.json Support and Node Compatibility
Deno 1.31 has arrived, bringing significant enhancements to the JavaScript runtime, which serves as a competitor to Node.js. A major highlight of this release is the introduction of package.json
support, aimed at facilitating smoother transitions for developers migrating from Node.js projects. This feature allows Deno to automatically detect a package.json
file, enabling it to install and resolve dependencies seamlessly. Additionally, developers can now run project-specific scripts defined within the scripts
section of package.json
using the deno task
command. Although this initial support is limited to simple scripts, more complex commands such as rimraf
or cross-env
are expected to be supported in future updates.
Stabilization of Node-API
Deno 1.31 also marks the stabilization of the Node-API (N-API), eliminating the need for developers to use the unstable flag when working with NPM packages that rely on this API. This change is crucial as it enhances compatibility and stability, allowing a broader range of packages to be integrated without complications. The release also addresses several bug fixes associated with N-API, further improving the overall developer experience. The Deno team is committed to resolving any remaining issues in the weeks to come, which is a positive sign for those relying on NPM packages in their projects.
Enhanced Node.js Compatibility Layer
In a move to simplify the user experience, Deno 1.31 has integrated the Node.js compatibility layer directly into the Deno runtime. Previously, developers needed to utilize a separate collection of polyfills from https://deno.land/std.node
, which required frequent updates and additional downloads with each Deno release. By embedding the compatibility layer into the runtime, the startup time has been significantly reduced, and the performance of built-in Node.js modules has improved. Developers can now easily access these embedded polyfills by importing from node:
specifiers, streamlining the process of working with existing Node.js codebases.
Accessing Deno 1.31
Deno 1.31 was unveiled on February 24 and can be accessed through the deno upgrade
command for current users. For new users or those looking to install Deno for the first time, various installation options are available on GitHub. This update builds upon the progress made in Deno 1.30, which had already improved support for Node.js modules. With these latest advancements, Deno continues to strengthen its position in the developer community, providing tools that bridge the gap between traditional Node.js applications and the modern capabilities of Deno.