Skip to content

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

Closed
@cscott

Description

@cscott

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions