njs
njs copied to clipboard
Destructuring/selective import support
It would be nice if njs supported destructuring/selective style for import:
import { export1 , export2 } from "module-name";
Without that support, we have to write ugly things, if we need only one or two functions and prefer short naming:
import utils from 'utils.js';
const is_string = utils.is_string;
...
if (is_string(x)) {
...
}
BTW, it seems to be similar in implementation with destructuring assignment support (var {a, b} = o
), which is also desired, but not supported yet.