
Security News
Node.js Drops Bug Bounty Rewards After Funding Dries Up
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.
Better error reporting for Node.js command-line apps.
epicfail converts
unhandledRejectionanduncaughtExceptioninto graceful and helpful error message for both users and developers.
⬇️ Prints error messages in copy and paste ready Markdown.
🌐 Asks users to report a bug (navigate users to bugs.url in package.json).
🍁 Shows machine environments (OS, Node.js version, etc).
👀 Suggests related issues in GitHub.
🛠 Integration with error aggregation service (like Sentry).
npm install --save epicfail
# or
yarn add epicfail
import { epicfail } from "epicfail";
epicfail(import.meta.url);
// your CLI app code goes here
fs.readFileSync("foo"); // => will cause "ENOENT: no such file or directory, open 'foo'"
const { epicfail } = require("epicfail");
epicfail(require.main.filename);
// your CLI app code goes here
fs.readFileSync("foo"); // => will cause "ENOENT: no such file or directory, open 'foo'"

true)Show stack trace.
import { epicfail } from "epicfail";
epicfail(import.meta.url, {
stacktrace: false,
});

false)Search and show related issues in GitHub Issues.
import { epicfail } from "epicfail";
epicfail(import.meta.url, {
issues: true,
});

Show environment information. You can find all possible options here. Set to false to disable it.
import { epicfail } from "epicfail";
epicfail(import.meta.url, {
env: {
System: ["OS", "CPU"],
Binaries: ["Node", "Yarn", "npm"],
Utilities: ["Git"],
},
});
Default values:
{
"System": ["OS"],
"Binaries": ["Node"]
}

true)Show bug tracker URL and ask users to report the error.
import { epicfail } from "epicfail";
epicfail(import.meta.url, { message: false });
() => false)While processing an error, if assertExpected(error) returns true, epicfail just prints the error message without any extra information; which is the same behaviour as the logAndExit() function described below.
import { epicfail } from "epicfail";
epicfail(import.meta.url, {
assertExpected: (err) => err.name === "ArgumentError",
});
undefined)Pass the function that process the error and returns event id issued by external error aggregation service.
import { epicfail } from "epicfail";
import Sentry from "@sentry/node";
epicfail(import.meta.url, {
onError: (err) => Sentry.captureException(err), // will returns an event id issued by Sentry
});
Use logAndExit() to print error message in red text without any extra information (stack trace, environments, etc), then quit program. It is useful when you just want to show the expected error message without messing STDOUT around with verbose log messages.
import { epicfail, logAndExit } from "epicfail";
epicfail(import.meta.url);
function cli(args) {
if (args.length === 0) {
logAndExit("usage: myapp <input>");
}
}
cli(process.argv.slice(2));
You can also pass an Error instance:
function cli(args) {
try {
someFunction();
} catch (err) {
logAndExit(err);
}
}
import { epicfail } from "epicfail";
import Sentry from "@sentry/node";
epicfail(import.meta.url, {
stacktrace: false,
env: false,
onError: Sentry.captureException, // will returns event_id issued by Sentry
});
Sentry.init({
dsn: "<your sentry token here>",
defaultIntegrations: false, // required
});
// your CLI app code goes here
fs.readFileSync("foo"); // => will cause "ENOENT: no such file or directory, open 'foo'"

import {epicfail} from 'epicfail';
epicfail(import.meta.url);
// 1. Use epicfail property in Error instance.
const expected = new Error('Wooops');
expected.epicfail = { stacktrace: false, env: false, message: false };
throw expected;
// 2. Use fail method
import { fail } from 'epicfail';
fail('Wooops', { stacktrace: false, env: false, message: false });
// 3. Use EpicfailError class (useful in TypeScript)
import { EpicfailError } from 'epicfail';
const err = new EpicfailError('Wooops', { stacktrace: false, env: false, message: false };);
throw err;
FAQs
Better error output for Node.js CLI apps
The npm package epicfail receives a total of 755 weekly downloads. As such, epicfail popularity was classified as not popular.
We found that epicfail 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
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.