
Product
Microsoft Teams Notifications Are Now Available in Socket
Socket can now send alerts and supply chain attack notifications to Microsoft Teams, with filters that route the right updates to each channel.
error-serialize
Advanced tools
Serialize and deserialize Error objects to plain objects, preserving cause chains and custom properties
Serialize and deserialize Error objects to plain objects, preserving cause chains and custom properties
npm install error-serialize
import {serialize, deserialize} from 'error-serialize';
const error = new TypeError('Invalid input');
error.code = 'ERR_INVALID';
const serialized = serialize(error);
//=> {name: 'TypeError', message: 'Invalid input', stack: '...', code: 'ERR_INVALID'}
const json = JSON.stringify(serialized);
const deserialized = deserialize(JSON.parse(json));
deserialized instanceof TypeError;
//=> true
import {serialize, deserialize} from 'error-serialize';
const cause = new RangeError('Value out of range');
const error = new Error('Operation failed', {cause});
const serialized = serialize(error);
serialized.cause.name;
//=> 'RangeError'
const restored = deserialize(serialized);
restored.cause instanceof RangeError;
//=> true
Returns a plain object with name, message, stack, and any custom enumerable properties. Recursively serializes error.cause. Non-Error values are returned as-is.
Type: Error
The Error object to serialize.
Returns an Error instance reconstructed from the plain object. Maps name to built-in error constructors (TypeError, RangeError, etc.). Recursively deserializes cause chains. Non-error objects are returned as-is.
Type: object
The plain object to deserialize.
MIT
FAQs
Serialize and deserialize Error objects to plain objects, preserving cause chains and custom properties
The npm package error-serialize receives a total of 98 weekly downloads. As such, error-serialize popularity was classified as not popular.
We found that error-serialize demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Product
Socket can now send alerts and supply chain attack notifications to Microsoft Teams, with filters that route the right updates to each channel.

Security News
pnpm 12 rewrites the package manager in Rust, cutting install times by up to 90% while preserving pnpm 11 workflows and lockfiles.

Security News
Socket CTO Ahmad Nassri joins AppSec leaders at Black Hat to discuss active malware, package manager risks, and software supply chain defense.