serialize-error
npmv13.0.1TypeScriptSerialize/deserialize an error into a plain object
Safe to adopt
Yes — serialize-error scores well across adoption, maintenance, weight, supply chain, and licensing. 32.8M downloads per week and 2 known dependents. Last published 234 days ago. 3 releases in the last 2 years.
- AAdoption: grade A, Excellent.
32.8M downloads per week and 2 known dependents.
- BMaintenance: grade B, Good.
Last published 234 days ago. 3 releases in the last 2 years.
- AWeight: grade A, Excellent.
Pulls in 3 transitive packages, about 596 KB installed.
- BSupply chain: grade B, Good.
This package has a single maintainer (bus factor of 1).
- ALicense: grade A, Excellent.
MIT — permissive, with no copyleft found in the dependency tree.
Grades are computed deterministically from registry metadata collected by PackageGraph — downloads, dependents, publish dates, the resolved dependency tree, maintainer count, and declared licenses. No third-party scores are used.
Install cost
What you actually take on by adding serialize-error to a project.
Runtime packages this one declares itself.
Distinct packages in the full runtime tree, deduplicated the way a package manager would.
Unpacked size of this package plus its entire runtime tree.
Longest resolved dependency chain below this package.
Licenses in the dependency tree
Every license you inherit by installing serialize-error, not just its own. Check this before a legal review, not after.
Compatibility
- Node.js
- node >=20
- Module format
- ESM only
- TypeScript
- Types included
- Install scripts
- None
Quick start
A usage example from the serialize-error README.
import {serializeError, deserializeError} from 'serialize-error';
const error = new Error('🦄');
console.log(error);
//=> [Error: 🦄]
const serialized = serializeError(error);
console.log(serialized);
//=> {name: 'Error', message: '🦄', stack: 'Error: 🦄\n at Object.<anonymous> …'}
const deserialized = deserializeError(serialized);
serialize-error vs the alternatives
Packages solving a similar problem in the npm ecosystem, compared on the signals that drive an adoption decision.
| Package | Weekly downloads | Dependents | License | Last release |
|---|---|---|---|---|
| serialize-errorthis page | 32.8M | 2 | MIT | 7 months ago |
| object-inspect | 164.9M | 24 | MIT | 9 days ago |
| non-error | 0 | 1 | MIT | 9 days ago |
| color-convert | 342.8M | 1 | MIT | 8 days ago |
| has-flag | 321.6M | 1 | MIT | 9 days ago |
| camelcase | 185M | 2 | MIT | 8 days ago |
Dependencies
Declared by serialize-error v13.0.1. Runtime dependencies are installed with the package; dev dependencies are not.
Runtime (2)
Dev (4)
Used by
Popular packages that depend on serialize-error.
Relationship graph
Dependencies (left) and dependents (right) of serialize-error.
Frequently installed together
A high-level API to control headless Chrome over the DevTools Protocol
Check if a value is a plain object
The fast, flexible & elegant library for parsing and manipulating HTML and XML.
A helper utility for logging of WebdriverIO packages
A simple list of CSS shorthand properties and which longhand properties they expand to
TypeScript definitions for node
TypeScript definitions for @sinonjs/fake-timers
CSS value parser
html formatter yo! Prettify or minify html.
Programmatic access to the ARIA specification
The lodash method `_.cloneDeep` exported as a module.
Create, read and edit .zip files with JavaScript http://stuartk.com/jszip
Release history
3 releases in the last two years, typically about 77 days apart.
| Version | Published | Size | License |
|---|---|---|---|
| 13.0.1latest | 7 months ago | 20 KB | MIT |
| 13.0.0 | 7 months ago | 19 KB | MIT |
| 12.0.0 | 1 year ago | 17 KB | MIT |
| 11.0.3 | 2 years ago | 16 KB | MIT |
| 11.0.2 | 3 years ago | 16 KB | MIT |
| 11.0.1 | 3 years ago | 16 KB | MIT |
| 11.0.0 | 4 years ago | 16 KB | MIT |
| 10.0.0 | 4 years ago | 16 KB | MIT |
| 9.1.1 | 4 years ago | 11 KB | MIT |
| 9.1.0 | 4 years ago | 11 KB | MIT |
| 9.0.0 | 4 years ago | 11 KB | MIT |
| 8.1.0 | 5 years ago | 10 KB | MIT |
| 8.0.1 | 5 years ago | 8.7 KB | MIT |
| 8.0.0 | 5 years ago | 8.7 KB | MIT |
| 7.0.1 | 6 years ago | 6.7 KB | MIT |
Overview
serialize-error is an npm package that serialize/deserialize an error into a plain object. It is extremely widely used, with about 32.8M downloads per week and 2 known dependents in the graph. The latest version is 13.0.1, released under the MIT license.
Who should use it
Teams working in the npm ecosystem who need serialize/deserialize an error into a plain object and value a battle-tested, widely-adopted solution.
When not to use it
Consider an alternative if you need to or if a more actively-maintained option better fits your npm stack.
Pros
- Large, well-established user base (32.8M weekly downloads).
- Ships TypeScript type definitions.
- Clear open-source license (MIT).
Cons
- No significant drawbacks detected from available metadata.
Auto-generated from collected registry metadata. No external claims are inferred.
Maintainers
Funding
Frequently asked questions
Should I use serialize-error?
Yes — serialize-error scores well across adoption, maintenance, weight, supply chain, and licensing. 32.8M downloads per week and 2 known dependents. Last published 234 days ago. 3 releases in the last 2 years.
How do I install serialize-error?
Run `npm install serialize-error` to add serialize-error to your npm project.
How many dependencies does serialize-error have?
serialize-error declares 6 direct dependencies and pulls in 3 packages in total once its runtime tree is resolved totalling about 596 KB on disk.
What license is serialize-error released under?
serialize-error is distributed under the MIT license. Its dependency tree also includes: (MIT OR CC0-1.0), MIT.
How popular is serialize-error?
serialize-error has approximately 32,775,741 downloads per week and 2 known dependent packages.
Is serialize-error still maintained?
The most recent release of serialize-error (v13.0.1) was published 7 months ago.
Does serialize-error run install scripts?
No. serialize-error does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.