VM2 Babel Compiler
A module for compiling nodejs code with Babel.
Since newer versions of node.js (8 and above) support almost everything natively, this module only uses the @babel/plugin-transform-modules-commonjs
plugin to transpile import/export
to require
and module.exports
.
Getting Started
Install:
npm install --save vm2-babel-compiler
A basic usage example:
const compile = ;const compiled =
Passing this compiler to VM2:
const NodeVM = ;const compile = ; compile;