Convert a subset of CommonJS/NodeJS module.exports assignments to ECMAScript 6 module export declarations.
Usage:
var cjs2es6export = require('cjs2es6export');
var src = "module.exports = function() { return 42; };"
var newSrc = cjs2es6export(src); // "export default function() {\n return 42;\n};;"
Currently only direct assignment to module.exports
(translated to default export
) is supported.
See also cjs2es6import
MIT