
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
util-callbackify
Advanced tools
util.callbackifyA backport of util.callbackify for Node.js 6.0 and up.
npm install --save util-callbackify
const callbackify = require('util-callbackify')
async function fn () {
return 'Hello, World!'
}
const callbackFunction = callbackify(fn)
fn((err, result) => {
if (err) throw err
console.log(result)
//=> Hello, World!
})
callbackify(original)original <Function> An async functionTakes an async function (or a function that returns a Promise) and returns a
function following the error-first callback style, i.e. taking
an (err, value) => ... callback as the last argument. In the callback, the
first argument will be the rejection reason (or null if the Promise
resolved), and the second argument will be the resolved value.
The callback is executed asynchronously, and will have a limited stack trace.
If the callback throws, the process will emit an 'uncaughtException'
event, and if not handled will exit.
Since null has a special meaning as the first argument to a callback, if a
wrapped function rejects a Promise with a falsy value as a reason, the value
is wrapped in an Error with the original value stored in a field named
reason.
function fn() {
return Promise.reject(null)
}
const callbackFunction = util.callbackify(fn)
callbackFunction((err, ret) => {
// When the Promise was rejected with `null` it is wrapped with an Error and
// the original value is stored in `reason`.
err && err.hasOwnProperty('reason') && err.reason === null // true
})
FAQs
A backport of `util.callbackify` for Node.js 6.0 and up.
The npm package util-callbackify receives a total of 33 weekly downloads. As such, util-callbackify popularity was classified as not popular.
We found that util-callbackify demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.