https://github.com/bttmly/make-module
make node modules from strings of code
https://github.com/bttmly/make-module
evaluation module nodejs
Last synced: 3 months ago
JSON representation
make node modules from strings of code
- Host: GitHub
- URL: https://github.com/bttmly/make-module
- Owner: bttmly
- License: mit
- Created: 2015-01-10T23:24:44.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2017-04-14T06:48:49.000Z (about 8 years ago)
- Last Synced: 2025-02-11T06:35:30.146Z (3 months ago)
- Topics: evaluation, module, nodejs
- Language: JavaScript
- Homepage:
- Size: 13.7 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# make-module [](https://travis-ci.org/bttmly/make-module) [](https://codecov.io/github/bttmly/make-module?branch=master)
Create a node module from a string of code, and maybe a file name.
`npm install make-module`
```js
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`
```