Deno 1.31, the latest version of the Node.js competitor runtime for JavaScript, TypeScript, and WebAssembly, adds package.json support. The new feature is among several improvements created to make it easier for developers to transition from existing Node.js projects.Deno now will immediately find a package.json and utilize it to set up and deal with dependences utilized. This also makes it possible for the running of project-specific scripts defined in the scripts section with deno job. Nevertheless, present support is limited to basic scripts. Programs such as rimraf or cross-env will not yet work, but assistance for them will be added in an upcoming release.Deno 1.31 likewise supports the Node-API (N-API ).
Developers no longer require utilize the unstable flag when utilizing NPM plans that count on this API. Numerous bug fixes were applied to Node-API and more plans can be utilized without problem. Remaining bugs will be dealt with in upcoming weeks.In addition, Deno 1.31 moves the compatibility layer for Node.js directly into the Deno runtime.
Previously, compatibility for Node.js was offered by using https:/ deno.land/ std.node, a collection of polyfills in userland code in the Deno standard library. Since dependency on https://deno.land/std needed to be bumped with each release of Deno, the compatibility layer needed to downloaded after each upgrade. Now the compatibility layer is embedded in the runtime and V8 JavaScript engine pictures are utilized to lower startup time. The tighter combination makes it possible for easier polyfilling of missing out on APIs and enhances the efficiency of integrated Node.js modules. To utilize embedded polyfills, designers can import from node: specifiers. Revealed February 24, Deno 1.31 can be accessed through deno upgrade for existing users. Other installation alternatives are listed on GitHub.
Deno 1.31 follows lastmonth’s release of Deno 1.30, which enhanced assistance for Node.js modules.Also in Deno 1.31: In a breaking change, guidelines now are represented as plain things, or null for null guidelines. These items are created by V8 and supported by V8 Quick API, improving performance of FFI (Foreign Function User interface)when dealing with “tip “type parameters and return values from previous variations. Tip objects are opaque and can not be manipulated directly from JavaScript. Thus, FFI becomes much safer to utilize, with pointer spoofing no longer as simple as composing a JavaScript number. Keep in mind that the FFI API is unstable. The Deno.Command and Deno.osUptime()APIs now are supported. Developers are advised to migrate from the Deno.run()API to Deno.Command. The Deno.build.os API now returns more versions for operating systems, such as