Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Destructuring/selective import support #420

Open
iamhere2 opened this issue Sep 16, 2021 · 0 comments
Open

Destructuring/selective import support #420

iamhere2 opened this issue Sep 16, 2021 · 0 comments
Assignees

Comments

@iamhere2
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants