Require modules from any URL
npm install import-url
const foo = await require('import-url')('module.now.sh')
console.log(foo()) //=> 'awesome!'
Right now it doesn't support modules requiring other modules. So if your remote module does a require()
it will fail.
Feel free to open an issue or a PR.
This module used to be named require-remote
and still still available on npm.
© 2017 Pablo Varela |