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

Add node: prefix to all built-in Node.js imports #255

Open
sntran opened this issue Jul 31, 2024 · 2 comments
Open

Add node: prefix to all built-in Node.js imports #255

sntran opened this issue Jul 31, 2024 · 2 comments

Comments

@sntran
Copy link

sntran commented Jul 31, 2024

Describe the bug
The library uses a couple Node.js built-in modules like fs, events, net, tls, stream and path. It would be great if their imports have node: prefix. The goal is to make it comparable with other runtimes like Cloudflare Workers (pending cloudflare/workerd#2217) and Deno. The changes required are minimal, but can widen the audience of the library.

@patrickjuchli
Copy link
Owner

This library supports Node 10. When exactly was the prefix node: introduced? Is it backwards-compatible?

Depending on a later version of Node will require this library to release a new major version.

@sntran
Copy link
Author

sntran commented Aug 1, 2024

Ah. The node: prefix was introduced in v14.13.1, v12.20.0 so it won't be backward compatible for Node 10.x.

What's about releasing a separate ESM version with the prefix? Older Node.js can use the CJM require as normal.

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

No branches or pull requests

2 participants