a commonJS hook to load modules from url at runtime.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.vscode
__test
screenshot
src
.gitignore
.travis.yml
LICENSE
README-CN.md
README.md
package-lock.json
package.json
yarn.lock

README.md

NEDO

Node CommonJS require enhancer, could load module from url or ts at runtime ...

Build Status code style: prettier

[English doc] [中文文档]

USAGE

  • load module from url
const r = require("nedo");

const res = r(
  "https://raw.githubusercontent.com/loatheb/nedo/master/__test/case/code.js"
);
console.log(res); // hello code.js
  • load module from ts file
const r = require("nedo");

const res = r("./code.ts");
console.log(res); // hello code.ts
  • top level await
// index.js
const r = require("nedo");

r("./code.js");


// code.js: you don't need wrap await into async a function...
await doSomeAsyncThings();

TESTCASE

you can touch the testcase __test/index.js for much more detail.

https://github.com/loatheb/nedo/blob/master/screenshot/testcase.jpg

LICENSE

MIT