json-stringify-safe
npmv5.0.1Like JSON.stringify, but doesn't blow up on circular refs.
Not recommended for new projects
No — json-stringify-safe should not be adopted for new projects. Last published 4132 days ago.
- AAdoption: grade A, Excellent.
36.4M downloads per week and 1 known dependents.
- FMaintenance: grade F, Failing.
Last published 4132 days ago.
- AWeight: grade A, Excellent.
Zero runtime dependencies.
- ASupply chain: grade A, Excellent.
No install scripts, 2 maintainers, and a contained dependency surface.
- ALicense: grade A, Excellent.
ISC — 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 json-stringify-safe 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.
Compatibility
- Node.js
- No constraint declared
- Module format
- CommonJS only
- TypeScript
- No bundled types
- Install scripts
- None
Quick start
A usage example from the json-stringify-safe README.
var stringify = require('json-stringify-safe');
var circularObj = {};
circularObj.circularRef = circularObj;
circularObj.list = [ circularObj, circularObj ];
console.log(stringify(circularObj, null, 2));json-stringify-safe 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 |
|---|---|---|---|---|
| json-stringify-safethis page | 36.4M | 1 | ISC | 11 years ago |
| jsesc | 158.9M | 1 | MIT | 18 hours ago |
| fast-json-stable-stringify | 137.5M | 2 | MIT | 1 day ago |
| json-stable-stringify-without-jsonify | 72.1M | 1 | MIT | 1 day ago |
| @nodable/entities | 0 | 2 | MIT | 1 day ago |
| fast-json-stringify | 0 | 3 | MIT | 18 hours ago |
Dependencies
Declared by json-stringify-safe v5.0.1. Runtime dependencies are installed with the package; dev dependencies are not.
Dev (3)
Used by
Popular packages that depend on json-stringify-safe.
Relationship graph
Dependencies (left) and dependents (right) of json-stringify-safe.
Frequently installed together
RFC9562 UUIDs
The ultimate javascript content-type utility.
Port of jQuery.extend for node.js and the browser
HTTP proxy tunneling agent. Formerly part of mikeal/request, now a standalone module.
Signs and prepares requests using AWS Signature Version 4
Reference implementation of Joyent's HTTP Signature scheme.
Caseless object set/get/has, very useful when working with HTTP headers.
AWS signing. Originally pulled from LearnBoost/knox, maintained as vendor in request, now a standalone module.
OAuth 1 signing. Formerly a vendor lib in mikeal/request, now a standalone module.
Extremely fast HTTP Archive (HAR) validator using JSON Schema
A library to create readable "multipart/form-data" streams. Can be used to submit forms and file uploads to other web applications.
A stream that emits multiple other streams one after another.
Release history
No releases in the last two years, typically about 143 days apart.
| Version | Published | Size | License |
|---|---|---|---|
| 5.0.1latest | 11 years ago | — | ISC |
| 5.0.0 | 13 years ago | — | BSD |
| 4.0.0 | 13 years ago | — | BSD |
| 3.0.0 | 13 years ago | — | BSD |
| 2.0.0 | 13 years ago | — | BSD |
Overview
json-stringify-safe is an npm package that like JSON.stringify, but doesn't blow up on circular refs. It is extremely widely used, with about 36.4M downloads per week and 1 known dependents in the graph. The latest version is 5.0.1, released under the ISC license.
Who should use it
Teams working in the npm ecosystem who need like JSON.stringify, but doesn't blow up on circular refs and value a battle-tested, widely-adopted solution.
When not to use it
Consider an alternative if you need to have first-class TypeScript types out of the box, or if a more actively-maintained option better fits your npm stack.
Pros
- Large, well-established user base (36.4M weekly downloads).
- Clear open-source license (ISC).
- Lean dependency tree (3 direct dependencies).
Cons
- No bundled TypeScript types (may require a separate @types package).
Auto-generated from collected registry metadata. No external claims are inferred.
Frequently asked questions
Should I use json-stringify-safe?
No — json-stringify-safe should not be adopted for new projects. Last published 4132 days ago.
How do I install json-stringify-safe?
Run `npm install json-stringify-safe` to add json-stringify-safe to your npm project.
What license is json-stringify-safe released under?
json-stringify-safe is distributed under the ISC license.
How popular is json-stringify-safe?
json-stringify-safe has approximately 36,432,614 downloads per week and 1 known dependent packages.
Is json-stringify-safe still maintained?
The most recent release of json-stringify-safe (v5.0.1) was published 11 years ago.
Does json-stringify-safe run install scripts?
No. json-stringify-safe does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.