
Security News
Insecure Agents Podcast: Certified Patches, Supply Chain Security, and AI Agents
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.
json-decycle
Advanced tools
Stringify and parse cycled reference json by replacing cycled references to JSON-reference
Yes, it works just fine.
Because this library have no dependencies, it's not required to have frequent updates.
If You encounter a bug or need to support special case, feel free to file an issue or open PR.
import { decycle, retrocycle } from "json-decycle";
var cycled = {
foo: {},
bar: {},
};
cycled.foo.bar = cycled.foo;
cycled.bar.foo = cycled.bar;
var result = JSON.stringify(cycled, decycle());
// result === '{"foo":{"bar":{"foo":{"$ref":"#/foo"}}},"bar":{"$ref":"#/foo/bar"}}'
JSON.parse(result, retrocycle());
// => {foo: {{foo: [cyclic reference], bar: [cyclic reference]}}, bar: {{foo: [cyclic reference], bar: [cyclic reference]}}}
JSON.parse and JSON.stringify is not modified
import { extend } from "json-decycle";
JSON.decycle({}) === "{}";
JSON.retrocycle("{}") === {};
FAQs
Stringify and parse cycled reference json
The npm package json-decycle receives a total of 855 weekly downloads. As such, json-decycle popularity was classified as not popular.
We found that json-decycle demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.

Security News
The planned feature introduces a review step before releases go live, following the Shai-Hulud attacks and a rocky migration off classic tokens that disrupted maintainer workflows.