Package Exports
- morpher
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (morpher) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Morpher
JavaScript AST transformer and code generator, optimized for older engines.
Inspired by Falafel (https://github.com/substack/node-falafel), but modified for performance in older JavaScript engines (eg. IE8.)
Example
var code = 'var result = 1 + 2;';
var ast = acorn.parse(code, {ranges: true});
var transpiledCode = morpher.morph(code, ast, function (node, parent, replace, source) {
if (node.type === 'BinaryExpression') {
replace(node, 'postProcess(' + source(node) + ')');
}
});
console.log(transpiledCode); // Outputs `var result = postProcess(1 + 2);`
Keeping up to date
- Follow me on Twitter for updates: https://twitter.com/@asmblah