NPM compatibility is featured in Deno 1.28, unveiled November 14. NPM support makes it easier to build apps, the Deno developers said, because developers now can use persistent data modules such as MySQL, Mongoose, and Prisma, and front end frameworks such as React and Vue. The project has posted instructions for getting started with Prisma, Mongoose, and Apollo.
Deno’s builders said using NPM is safer with Deno, due to Deno’s secure-by-default, opt-in permissions model. Importing NPM modules is done through URLs in a standard-compliant fashion. Developers can use NPM packages by importing an
Deno’s developers intend to make as many NPM modules compatible with Deno as possible. Some modules may not yet be compatible because of edge cases, post-install scripts, or assumptions some packages make about executing a folder with a typical Node.js setup. Plans call for addressing these issues in coming months.
Also with Deno 1.28, the lock file will be automatically discovered and used if a configuration file (
deno.json(c) ) is discovered. In this case, a lock file will be automatically created if one does not yet exist, next to the configuration file, with the
deno.lock name. The lock file will be updated if new dependencies become part of the module graph.
Copyright © 2022 IDG Communications, Inc.