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

Proposal: return Promises as well as taking callbacks. #88

Closed
cscott opened this issue Dec 5, 2014 · 1 comment · May be fixed by solebox/node#25, UbuntuEvangelist/node#17, saeedahassan/node#35, erdun/node#41 or enterstudio/node#24

Comments

@cscott
Copy link
Contributor

cscott commented Dec 5, 2014

Here is a proposal for gradually moving node.js toward the ES6 future: all async methods in the node standard library which currently take a callback and return no value would instead be extended to return a Promise which can be used instead of the callback. (The callback would become optional, if it is not already. If you are really worried about performance for legacy code, you can return the Promise only if no callback is supplied by the caller.)

This would eliminate the need for extensive promisify calls in code using ES6 Promises (or ES7 async functions), and provide an API like that enabled by the nodify functions in bluebird and prfun.

@cscott cscott mentioned this issue Dec 5, 2014
@cjihrig
Copy link
Contributor

cjihrig commented Dec 5, 2014

Closing as a duplicate of #11

@cjihrig cjihrig closed this as completed Dec 5, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment