Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Will there be an ES6 compatible module system (import/export) in iojs?

Tags:

io.js

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
like image 254
paul van bladel Avatar asked Jan 30 '15 12:01

paul van bladel


1 Answers

Comment about ES6 module support from io.js core team member: https://github.com/iojs/io.js/issues/1043#issuecomment-78030670

like image 63
Ilkka Oksanen Avatar answered May 17 '23 00:05

Ilkka Oksanen