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

Use node:-prefixed imports for Node.js core modules #773

Open
olriko opened this issue Jul 4, 2024 · 0 comments
Open

Use node:-prefixed imports for Node.js core modules #773

olriko opened this issue Jul 4, 2024 · 0 comments

Comments

@olriko
Copy link

olriko commented Jul 4, 2024

Currently, the package uses bare specifiers to import Node.js core modules. This prevents the package from being used in environments like Cloudflare Workers Runtime, which don't support Node.js APIs.

To improve compatibility, we should update our imports to use the node: prefix for all Node.js core modules.

Example change:

  • import fs from 'fs';
  • import fs from 'node:fs';

image
https://developers.cloudflare.com/workers/runtime-apis/nodejs/

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

1 participant