0.1.0 • Published 6 years ago

@axetroy/context v0.1.0

Weekly downloads
1
License
Apache
Repository
github
Last release
6 years ago

Create NodeJs context

Greenkeeper badge Build Status Coverage Status Dependency License Prettier Node npm version

Usage

const vm = require('vm');
const Context = require('@axetroy/context');

const context = new Context('./index.js');
const script = new vm.Script(`
const path = require('path');
console.log('current file is: ', __filename); // current/work/dir/index.js
console.log('current work dir:: ', process.cwd());  // current/work/dir
`);

script.runInNewContext(context);

Contributing

Contributing Guid

Contributors

Axetroy💻 🐛 🎨

License

FOSSA Status