Skip to content
New issue

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

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

Already on GitHub? # to your account

Use new node: URLs where applicable? #96

Closed
mattcollier opened this issue Jan 25, 2022 · 2 comments
Closed

Use new node: URLs where applicable? #96

mattcollier opened this issue Jan 25, 2022 · 2 comments

Comments

@mattcollier
Copy link
Contributor

mattcollier commented Jan 25, 2022

This feature landed in Node 14.13.1

[EDIT] in 14.180+ this syntax can also be used with require().

https://nodejs.org/api/esm.html#node-imports

https://2ality.com/2021/12/node-protocol-imports.html
nodejs/node#38343
nodejs/node#37246
nodejs/node#35387

Among other things, this is in support of "a more extensive standard library in JavaScript" that will eventually be put into the node: namespace and allows the re-use of existing NPM package names without conflicts.
https://github.com/tc39/proposal-built-in-modules

@davidlehn
Copy link
Member

In case this should be enforced, even with an option for require:
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-node-protocol.md

There are probably other things in that library too. I wanted to use the module checks as well:
digitalbazaar/eslint-config-digitalbazaar#55

@dlongley
Copy link
Member

v6 uses node: imports.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants