Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Apr 14, 2024 via pnpm

json-stringify-safe 5.0.1

Like JSON.stringify, but doesn't blow up on circular refs.
Package summary
Share
0
issues
1
license
1
ISC
Package created
19 Feb 2013
Version published
19 May 2015
Maintainers
2
Total deps
1
Direct deps
0
License
ISC

Issues

0
This package has no issues

Licenses

ISC License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
json-stringify-safe@5.0.1
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
β“˜ This is a list of json-stringify-safe 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does json-stringify-safe do?

The json-stringify-safe is a popular npm package that behaves like JSON.stringify, but the key difference being that it doesn't throw an error on circular references. Circular references happen when there's a property of the object which refers to the object itself, often causing infinite loop errors when stringifying with JSON. The json-stringify-safe npm package carefully handles such scenarios, making it a safe way to stringify JSON without encountering unexpected exceptions.

How do you use json-stringify-safe?

Here is how you can utilize the functionality of the json-stringify-safe package. First off, you need to install the package via npm and then import it into your JavaScript project.

You can install it by running the following command on your terminal:

npm install json-stringify-safe

Once installed, you can use it in your JavaScript file like this:

var stringify = require('json-stringify-safe');
var circularObj = {};
circularObj.circularRef = circularObj;
circularObj.list = [ circularObj, circularObj ];
console.log(stringify(circularObj, null, 2));

This code example uses require to import the json-stringify-safe module, creates a circular object, and then calls the stringify function with the circular object. The function successfully turns the circular object into a JSON string, which is then printed on the console.

Where are the json-stringify-safe docs?

You can find the json-stringify-safe documentation on its GitHub page. The documentation contains detailed usage instructions and information, elaborates on the usage of the stringify function and how to handle various cases, including how to pass a custom decycler function. It is a comprehensive source of information for anyone interested in learning more about the json-stringify-safe package and how it operates.