node2es6
v1.0.0
Published
converts js files written with node modules in mind to support es6 modules.
Downloads
2
Readme
node2es6
converts js files written with node modules in mind to support es6 modules.
e.g.
given
let add1 = a => a + 1;
let double = a => a * 2;
let two = 2;
class Four {
four() {
return 4;
}
}
module.exports = {add1, double, two, Four};
module.exports.square = a => {
return a * a;
};
module.exports.three = 3;
module.exports.Five = class {
five() {
return 5;
}
};
node2es6 input.js output.js
will convert to
let add1 = a => a + 1;
let double = a => a * 2;
let two = 2;
class Four {
four() {
return 4;
}
}
export {add1, double, two, Four};
export let square = a => {
return a * a;
};
export let three = 3;
export let Five = class {
five() {
return 5;
}
};
this markdown was generated by de-document-examples