Skip to content

Support util.promisify.custom as a global symbol #31647

Closed
@ExE-Boss

Description

Is your feature request related to a problem? Please describe.

Currently, util.promisify supports the util.promisify.custom symbol to provide a custom promisified version of the callback-taking function, this however doesn’t work cross‑realm and doesn’t work for packages that intend to support browsers.

There are currently several packages that provide util.promisify, but aren’t interoperable because of this (ex.: @nodejs’s built‑in util.promisify, @browserify’s util.promisify and @ljharb’s util.promisify)

Describe the solution you'd like

The best solution would be to expose this as a shared symbol using Symbol.for, like how #20821 (#20857) was done for util.inspect.custom.

The shared symbol would preferably be obtained using Symbol.for("nodejs.util.promisify.custom").

Describe alternatives you've considered

Keep the status quo and use a package like @mafintosh’s inspect‑custom‑symbol.

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