Package Exports
- simple-safe-stringify
- simple-safe-stringify/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (simple-safe-stringify) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
simple safe stringify
A JSON stringifier that does not fail on circular structures or bigints
Usage
- Install the package
npm i simple-safe-stringify
- Import the module in your project
import { stringifySafe } from "simple-safe-stringify";
- Stringify any object
const circularObject = {
some: {
levels: {
deep: null
}
}
};
circularObject.some.levels.deep = circularObject.some;
const json = stringifySafe(circularObject);
console.log(json); // '{"some":{"levels":{"deep":"[CIRCULAR #1]"}}}'