package.json support. The new feature is one of several enhancements designed to make it easier for developers to transition existing Node.js projects.
Deno will now automatically detect a
package.json and use it to install and resolve the dependencies used. This also allows the execution of project-specific scripts defined in the
scripts section with
deno task. However, current support is limited to simple scripts. Programs like
cross-env won’t work yet, but support for them will be added in a future release.
Deno 1.31 also stabilizes the Node-API (N-API). Developers no longer need to use the
unstable flag when using NPM packages that are based on this API. Lots of bug fixes applied to Node-API and more packages can be used without issue. The remaining bugs will be addressed in the coming weeks.
Additionally, Deno 1.31 moves the Node.js compatibility layer directly into the Deno runtime. Previously, Node.js support was provided through the use of
https:/deno.land/std.node, a collection of polyfills in userspace code in the Deno standard library. Because the dependency of
Released on February 24, Deno 1.31 can be accessed via
deno upgrade for current users. Other installation options are listed on GitHub. Deno 1.31 follows last month’s release of Deno 1.30, which improved compatibility with Node.js modules.
Also in Deno 1.31:
- In a major change, pointers are now represented as plain or null objects for null pointers. These objects are created by V8 and are supported by the V8 Fast API, which improves FFI (External Function Interface) performance when working with
Deno.osUptime()APIs are now stabilized. Developers are advised to migrate from the
Deno.build.osThe API now returns more variants for operating systems, such as
- For the standard library, modules for
https://deno.land/std/nodehave been removed. This code is now directly embedded in the Deno runtime.
- For the command interface, the
deno bundleThe command is no longer supported and will not appear in the help output.
- Also for the CLI,
deno benchcodenow accept a
--jsonflag that will print the reference results as JSON.
- The interactive permission prompt now accepts a new option,
A. This option enables the granting of permissions for subsequent API calls using the granted domain.
deno compilenow understands dynamic imports that can be resolved at compile time.
Copyright © 2023 IDG Communications, Inc.
Be First to Comment