-
Notifications
You must be signed in to change notification settings - Fork 5.6k
feature-request: Expose the same API in node.js #2184
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
Comments
That is a non goal from https://deno.land/manual.html#introduction
|
Some polyfills are available as third-party modules but it will not be implementend in |
As @zekth suggests, we could have an API in deno_std that acts as a polyfill. Something like this: import { readFileSync } from "https://deno.land/std/node/fs" |
Having it in |
Thank you for not killing this proposal outright on the spot :-) Node.js API surface is enormous with lots of legacy pre-async-await artifacts. Bringing it into Deno is indeed undesirable. If we could bring Deno API to Node.js, one way or another, it would make way to write libraries that support both Deno and Node.js. |
The only thing we need to focus on is the CI checking. We have to make test between Or maybe we can gather development with this issue: denoland/std#333 |
I agree that we might want to dedicate another repo instead of deno_std for the node-compat modules, since we are likely to need two different kind of issue trackers |
@kevinkassimo I'm not opposed to doing it in a separate repo - but why do they need to different kind of issue trackers? |
@ry Since I believe most of the issues will be about incompatibilities/different output with Node API instead of proposing new functionalities |
@kevinkassimo Ok sure. Does anyone want to start a repo outside of denoland for this? We can point people to it in the manual as the semi-official binding layer. I feel like things might move faster if I'm not in the loop. If it works out and is useful we can consider moving it into deno_std later. |
@kevinkassimo Creating https://github.com/denolib/node so ? |
@zekth Yeah I think this works |
@zekth @ry Inited project in https://github.com/denolib/node |
There's also https://www.npmjs.com/package/deno which tries to bring the Deno API to Node (see: denoland/deno_install#6). |
Following... I might be able to assist with this. |
Closing in favor of #2644 |
Would it be possible to get access to exactly the same API in Node.js?
I found the API surface overall to be exquisitely neatly designed, and I like it a lot. I'd like to be able to seamlessly switch between Deno and Node.js without memorizing strikingly different OS/file APIs.
The text was updated successfully, but these errors were encountered: