I cannot find anywhere info about what the plans will be with this ES6 feature. It would be very useful to have something similar as in the browser.
//------ lib.js ------
export const sqrt = Math.sqrt;
export function square(x) {
return x * x;
}
export function diag(x, y) {
return sqrt(square(x) + square(y));
}
//------ main.js ------
import { square, diag } from 'lib';
console.log(square(11)); // 121
console.log(diag(4, 3)); // 5
Comment about ES6 module support from io.js core team member: https://github.com/iojs/io.js/issues/1043#issuecomment-78030670
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With