basic-ftp icon indicating copy to clipboard operation
basic-ftp copied to clipboard

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

Open sntran opened this issue 1 year ago • 2 comments

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 https://github.com/cloudflare/workerd/pull/2217) and Deno. The changes required are minimal, but can widen the audience of the library.

sntran avatar Jul 31 '24 23:07 sntran

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.

patrickjuchli avatar Aug 01 '24 17:08 patrickjuchli

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.

sntran avatar Aug 01 '24 17:08 sntran