
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.
stringifiable-error
Advanced tools
Allow instances of Error to be serialized implicitly by JSON.stringify()
Enhances Error.prototype with a toJSON() method so that errors can be
serialized without explicit transformation.
npm install stringifiable-error
You only need to import (or require()) 'stringifiable-error' for its side
effects once, typically in the primary entry point to your program.
import 'stringifiable-error'
Then, wherever you need to serialize an error, JSON.stringify() will work.
try {
// ...
} catch (error) {
// `logger` serializes `error` before saving it.
logger.error(error)
}
// The serialized error:
//
// {
// "type": "AssertionError",
// "message": "`3 + 5` is `7`",
// "stack": [
// "fn (/.../src/client.ts:35:3)",
// "Object.<anonymous> (/.../src/client.ts:40:3)",
// "Module._compile (module.js:649:30)",
// "Module.m._compile (/.../node_modules/ts-node/src/index.ts:403:23)",
// "Module._extensions..js (module.js:660:10)",
// "Object.require.extensions.(anonymous function) [as .ts] (/.../node_modules/ts-node/src/index.ts:406:12)",
// "Module.load (module.js:561:32)",
// "tryModuleLoad (module.js:501:12)",
// "Function.Module._load (module.js:493:3)",
// "Function.Module.runMain (module.js:690:10)"
// ],
// "actual": false,
// "code": "ERR_ASSERTION",
// "expected": true,
// "generatedMessage": false,
// "name": "AssertionError [ERR_ASSERTION]",
// "operator": "=="
// }
FAQs
Allow instances of Error to be serialized implicitly by JSON.stringify()
We found that stringifiable-error 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.