Evaluate a bundle of CommonJS modules across JavaScript runtimes.
npm i bare-bundle-evaluate
const Bundle = require('bare-bundle')
const evaluate = require('bare-bundle-evaluate')
const bundle = new Bundle()
.write('/foo.js', 'module.exports = require(\'./bar\')', {
main: true
})
.write('/bar.js', 'module.exports = 42')
.mount(new URL(__dirname, 'file://'))
evaluate(bundle).exports
// 42
Apache-2.0