/make-module

make node modules from strings of code

Primary LanguageJavaScriptMIT LicenseMIT

make-module Build Status codecov.io

Create a node module from a string of code, and maybe a file name.

npm install make-module

var file = path.join(__dirname, "./some-module.js");
var code = fs.readFileSync(file).toString();
var someModule = makeModule(code, file);
// find `module.exports` at `someModule.exports`