-
Notifications
You must be signed in to change notification settings - Fork 633
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
suggestion(fs): make std/fs
Node-compatible
#4313
Comments
What's the goal? Even if Adding Node dependencies to Deno's Std just so folks can use |
I saw some mentions about the std scope should change to Also i guess deno team is making this |
std/fs
Node-compatiblestd/fs
Node-compatible
Imho I think it would be nice. People using It's a shame we're not able to use Apart from the io calls these algorithms aren't intrinsically connected to deno itself, most of the logic is about iterating over paths, states and handling errors, etc. The low-level calls like Also I disagree on the stance we should force developers to write node code to make compatible apps, it reinforces the idea that node is the standard and encourages people to write node-only code |
Let me summarize my only concern. If I'm using As long as that concern is addressed, I'm fine. |
Maybe we could do what This current issue is specifically about node compatibility in I do agree however that each package should not introduce node dependencies just for the sake of being compatible with it, especially when there are well-defined standards (which is not the case for fs atm). |
I would suggest we would add FS APIs from Deno namespace ( https://docs.deno.com/api/deno/file-system ) to
Node.js now has if (isDeno) {
// existing code for deno
} else if (isNode) {
const fs = process.getBuiltinModule("node:fs");
// ... code for node using node:fs
} |
To clarify further on this with a practical example - if I want to write a JSR package that is compatible with both Deno and Node (and Bun), then I am essentially forced to use In other words, the backwards compatibility with Node that Deno has makes it much easier to just write a Node-first package and Deno'll probably be able to run it. Node doesn't have Deno compatibility, and so having this Deno-only The fact that |
The Standard Library is now on JSR, and JSR now lists the runtimes compatible with any given package. A recent request was that
std/fs
be made Node-compatible. We should investigate the viability of this idea and how it can be done. Ideas are welcome.The text was updated successfully, but these errors were encountered: