
Security News
GitHub Actions Pricing Whiplash: Self-Hosted Actions Billing Change Postponed
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.
async-error-stack
Advanced tools
For better error stacks in async code.
Problems I want to solve:
Problem #2 is seen in this:
const async = require('async');
async.series({
one: function (callback) {
setTimeout(function () {
callback(null, 1);
}, 200);
},
two: function (callback) {
setTimeout(function () {
callback(new Error('BOOM!'));
}, 100);
}
}, function (err, results) {
if (err) return void console.error(err);
/*
Error: BOOM!
at Timeout._onTimeout (/Users/zacharyryansmith/Code/sandbox/index.js:26:22)
at ontimeout (timers.js:475:11)
at tryOnTimeout (timers.js:310:5)
at Timer.listOnTimeout (timers.js:270:5)
*/
});
This lib uses longjohn to solve problems #2 and #3, and own code to solve #1:
STACK FILTERED BY !line.includes('node_modules/async/')
Error: BOOM!
at Timeout.<anonymous> (/Users/zacharyryansmith/Code/sandbox/index.js:35:22)
at ontimeout (timers.js:475:11)
at tryOnTimeout (timers.js:310:5)
at Timer.listOnTimeout (timers.js:270:5)
---------------------------------------------
at two (/Users/zacharyryansmith/Code/sandbox/index.js:34:9)
at Timeout.<anonymous> (/Users/zacharyryansmith/Code/sandbox/index.js:30:13)
at ontimeout (timers.js:475:11)
---------------------------------------------
at one (/Users/zacharyryansmith/Code/sandbox/index.js:29:9)
at Object.<anonymous> (/Users/zacharyryansmith/Code/sandbox/index.js:27:7)
---------------------------------------------
FULL STACK
---------------------------------------------
Error: BOOM!
at Timeout.<anonymous> (/Users/zacharyryansmith/Code/sandbox/index.js:35:22)
at ontimeout (timers.js:475:11)
at tryOnTimeout (timers.js:310:5)
at Timer.listOnTimeout (timers.js:270:5)
---------------------------------------------
at two (/Users/zacharyryansmith/Code/sandbox/index.js:34:9)
at /Users/zacharyryansmith/Code/sandbox/node_modules/async/dist/async.js:3866:24
at replenish (/Users/zacharyryansmith/Code/sandbox/node_modules/async/dist/async.js:998:17)
at iterateeCallback (/Users/zacharyryansmith/Code/sandbox/node_modules/async/dist/async.js:983:17)
at /Users/zacharyryansmith/Code/sandbox/node_modules/async/dist/async.js:958:16
at /Users/zacharyryansmith/Code/sandbox/node_modules/async/dist/async.js:3871:13
at Timeout.<anonymous> (/Users/zacharyryansmith/Code/sandbox/index.js:30:13)
at ontimeout (timers.js:475:11)
---------------------------------------------
at one (/Users/zacharyryansmith/Code/sandbox/index.js:29:9)
at /Users/zacharyryansmith/Code/sandbox/node_modules/async/dist/async.js:3866:24
at replenish (/Users/zacharyryansmith/Code/sandbox/node_modules/async/dist/async.js:998:17)
at /Users/zacharyryansmith/Code/sandbox/node_modules/async/dist/async.js:1002:9
at eachOfLimit (/Users/zacharyryansmith/Code/sandbox/node_modules/async/dist/async.js:1027:24)
at /Users/zacharyryansmith/Code/sandbox/node_modules/async/dist/async.js:1032:16
at _parallel (/Users/zacharyryansmith/Code/sandbox/node_modules/async/dist/async.js:3865:5)
at Object.series (/Users/zacharyryansmith/Code/sandbox/node_modules/async/dist/async.js:4721:5)
at Object.<anonymous> (/Users/zacharyryansmith/Code/sandbox/index.js:27:7)
Not recommended for use in production, so you can disable it by setting process.env.ASYNC_ERROR_STACK=0 or passing in @disable.
This uses longjohn, which states:
"Longjohn collects a large amount of data in order to provide useful stack traces. While it is very helpful in development and testing environments, it is not recommended to use longjohn in production. The data collection puts a lot of strain on V8's garbage collector and can greatly slow down heavily-loaded applications."
$ npm install async-error-stack
const async = require('async');
// How to require:
const errStackLib = require('async-error-stack');
// Can also disable by setting process.env.ASYNC_ERROR_STACK=0.
// @disable overrides process.env.ASYNC_ERROR_STACK.
const { addCleanStack, ERR } = errStackLib({
disable: process.env.NODE_ENV === 'production',
logger: console /* console is default */
});
async.series({
one: function (callback) {
setTimeout(function () {
callback(null, 1);
}, 200);
},
two: function (callback) {
setTimeout(function () {
callback(new Error('BOOM!'));
}, 100);
}
}, function (err, results) {
// Example use of ERR.
// If err, then calls console.error(err) using @logger (which defaults to console).
// if (ERR(err)) return;
if (err) {
addCleanStack(err);
console.error(err);
}
});
FAQs
For better error stacks in async code.
We found that async-error-stack 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
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.