-
-
Notifications
You must be signed in to change notification settings - Fork 183
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
Support a promise API #210
Comments
Sounds good @SimenB! Although, what exactly are you suggesting? Converting existing methods or adding another one? |
#224 (comment) seems most likely (so a new API) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
(Sorta surprised no-one has opened an issue about this, sorry if one exists and my searching is just bad (there is sorta #151, but this issue is about native promise support, not promisification)).
Node's new ESM resolution supports promises, but not callbacks. If we wanna use
resolve
to implement a custom linker, a custom loader hook or the recently landedimport.meta.resolve
we'd need to manually wrapresolve
in a promise - it would be lovely ifresolve
natively worked with promises out of the box. I realise these APIs are behind experimental flags (or not even in any release), but I don't think there's any reason to believe the functionality these APIs provide will not be available whenever the APIs stabilize, and that they won't be based on promises.While one can promisify
resolve
manually, the problem is a bit extrapolated when considering the pluggable FS operations (recent versions of Node also ship with a promise based FS API). Based on #151util.promisify
doesn't work out of the box either.If accepted, I'm happy to work on the implementation.
The text was updated successfully, but these errors were encountered: