1.1.0 • Published 8 months ago
@nodejs-loaders/deno-npm-prefix v1.1.0
npm:
prefix loader for Node.js
Environments: dev, test
Compatible APIs: module.register
, module.registerHooks
This loader enables loading modules using the npm:
prefix in Node.js. This syntax is used most notably by Deno to import npm packages.
There is discussion within Node.js to introduce native support for this feature: nodejs/node#44492
Usage
After installing the loader and registering it with Node.js, you can use the npm:
prefix to import modules from npm. For example:
import express from 'npm:express';
!NOTE The resolution still happens in the
node_modules
directory, so you must have the package installed.