Skip to content

Instantly share code, notes, and snippets.

@rwaldron rwaldron/readme.md
Created Oct 2, 2018

Embed
What would you like to do?
mkdir test262-transformers
export TRANSFORMERS=$PWD/test262-transformers
cd test262-transformers
npm init -y
npm install --save @babel/core @babel/preset-env
touch spec.js 

Copy the contents to spec.js into your local spec.js

const babel = require("@babel/core");
const options = {
cwd: __dirname,
presets: [
[
"@babel/preset-env",
{
spec: true
}
]
]
};
module.exports = function(code) {
let c = babel.transform(code, options).code;
console.log(c);
return c;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.