-
-
Notifications
You must be signed in to change notification settings - Fork 33.5k
Closed
Labels
questionIssues that look for answers.Issues that look for answers.utilIssues and PRs related to the built-in util module.Issues and PRs related to the built-in util module.
Description
Since node 8 and the introduction of util.promisify()
many internal node modules have started using these two Symbol
s to provide hints to util.promisify()
as to how the function should be promisified. However, only Symbol(util.promisify.custom)
is readily available:
const customPromisifySymbol = require('util').promisify.custom
The second one Symbol(customPromisifyArgs)
is a bit more difficult to get a reference to, but it can be done:
const customArgsSymbol = Object.getOwnPropertySymbols(require('fs').read)
.find((s) => String(s) === 'Symbol(customPromisifyArgs)')
Would it be possible to also expose a reference to the latter in a more convenient way, maybe as require('util').promisify.args
? Is there a reason Symbol(customPromisifyArgs)
isn't exposed the same way as Symbol(util.promisify.custom)
?
justinmchase
Metadata
Metadata
Assignees
Labels
questionIssues that look for answers.Issues that look for answers.utilIssues and PRs related to the built-in util module.Issues and PRs related to the built-in util module.