
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
callback-tracker
Advanced tools
Track your callbacks.
This module is designed to help make sure that callback functions are called before exit, and not before you are done with them.
If they are called prematurely, then an error will be thrown.
If they are not called before exit, then the tracking info will be reported on stderr for your debugging convenience.
This module is designed to help debug the cb() never called! error
that happens in some cases when a bug in npm prevents it from
completing all operations.
var cbTracker = require('callback-tracker')
function someMethodOfMine(args, cb) {
// set up the tracking device
// cbTracker(cb, tagline)
// tagline should ideally be unique to this *call*
// but that is not essential. What's important is to provide
// enough details that you'll know wtf it was trying to do.
cb = cbTracker('some-method:' + args.join(':'), cb)
cb.track('start')
fs.readFile('some-file', function (er, data) {
cb.track('read the file')
if (er) return cb(er)
doSomethingWithData(data, function (er, res) {
cb.track('did stuff with data')
cb(er, res)
})
})
}
If the callback is not called before process.on('exit'), it'll print
out a log of how far along it got.
If any cb.track() calls are made after the callback, then it'll
throw an error and crash immediately.
The cb.track() function takes the same arguments and formats things
like console.log and the like.
trackCb(options, callback) Returns a tracked callback. Tracked
callbacks have a cb.track() method, and a cb.key property.trackCb.print() Dump currently in-progress trackers.trackCb.pretty() Return a prettified string of the trackers in
progress.The second argument to track-callback is an options object which can
contain the following fields:
track If set to false, then don't track stuff. This allows
conditionally tracking cb's based on an env var or whatever.key A key to use to track this callback. If already in use, then
a number will be appended to the end.FAQs
Track your callbacks.
We found that callback-tracker 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.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.