</>PackageGraphPackageGraph

json-stringify-safe

npmv5.0.1

Like 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.

0
Direct dependencies

Runtime packages this one declares itself.

0
Total installed

Distinct packages in the full runtime tree, deduplicated the way a package manager would.

Install size

Unpacked size of this package plus its entire runtime tree.

Tree depth

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.

javascriptFull 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.

PackageWeekly downloadsDependentsLicenseLast release
json-stringify-safethis page36.4M1ISC11 years ago
jsesc158.9M1MIT18 hours ago
fast-json-stable-stringify137.5M2MIT1 day ago
json-stable-stringify-without-jsonify72.1M1MIT1 day ago
@nodable/entities02MIT1 day ago
fast-json-stringify03MIT18 hours ago

Dependencies

Declared by json-stringify-safe v5.0.1. Runtime dependencies are installed with the package; dev dependencies are not.

Dev (3)

mocha >= 2.1.0 < 3must >= 0.12 < 0.13sinon >= 1.12.2 < 2

Used by

Popular packages that depend on json-stringify-safe.

Relationship graph

Dependencies (left) and dependents (right) of json-stringify-safe.

requestjson-stringify-sa…
json-stringify-safe dependencies dependents

Frequently installed together

Release history

No releases in the last two years, typically about 143 days apart.

Recent versions of json-stringify-safe
VersionPublishedSizeLicense
5.0.1latest11 years agoISC
5.0.013 years agoBSD
4.0.013 years agoBSD
3.0.013 years agoBSD
2.0.013 years agoBSD

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.

Maintainers

Keywords

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.