Support util.promisify.custom
as a global symbol #31647
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
.