Indexed by TopGit from live GitHub metadata: WebReflection/circular-json has 608 stars, written primarily in JavaScript. JSON does not handle circular references. Now it does
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
NOTE: Platforms without native JSON (i.e. MSIE <= 8) requires json3.js or similar.
It is also a bad idea to CircularJSON.parse(JSON.stringify(object)) because of those manipulation used in CircularJSON.stringify() able to make parsing safe and secure.
As summary: CircularJSON.parse(CircularJSON.stringify(object)) is the way to go, same is for JSON.parse(JSON.stringify(object)).
API
It's the same as native JSON, except the fourth parameter placeholder, which circular references to be replaced with "[Circular]" (i.e. for logging).
Bear in mind JSON.parse(CircularJSON.stringify(object)) will work but not produce the expected output.
Similar Libraries
Why Not the @izs One
The module json-stringify-safe seems to be for console.log() but it's completely pointless for JSON.parse(), being latter one unable to retrieve back the initial structure. Here an example:
// a logged object with circular references
{
"circularRef": "[Circular]",
"list": [
"[Circular]",
"[Circular]"
]
}
// what do we do with above output ?
Just type this in your node console: var o = {}; o.a = o; console.log(o);. The output will be { a: [Circular] } ... good, but that ain't really solving the problem.
However, if that's all you need, the function used to create that kind of output is probably faster than CircularJSON and surely fits in less lines of code.
Why Not {{put random name}} Solution
So here the thing: circular references can be wrong but, if there is a need for them, any attempt to ignore them or remove them can be considered just a failure.
Not because the method is bad or it's not working, simply because the circular info, the one we needed and used in the first place, is lost!
In this case, CircularJSON does even more than just solve circular and recursions: it maps all same objects so that less memory is used as well on deserialization as less bandwidth too!
It's able to redefine those references back later on so the way we store is the way we retrieve and in a reasonably performant way, also trusting the snappy and native JSON methods to iterate.
How active is development on WebReflection/circular-json?
The most recent commit recorded on WebReflection/circular-json was 7.2 years ago, based on the GitHub push timestamp. The repository has 79 forks — one of the better signals of community interest.
How many stars does WebReflection/circular-json have?
WebReflection/circular-json has 608 GitHub stars — refresh the page for the live number, or check github.com/WebReflection/circular-json. TopGit mirrors GitHub's count but does not claim minute-by-minute accuracy.
Is WebReflection/circular-json open source?
Yes — WebReflection/circular-json ships under the MIT license, which makes its source code freely readable (and, depending on license terms, forkable and reusable). Source: github.com/WebReflection/circular-json.
What is WebReflection/circular-json?
WebReflection/circular-json (WebReflection/circular-json) is a JavaScript project on GitHub. From the project's own README: JSON does not handle circular references. Now it does
Where do I read more about WebReflection/circular-json?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/WebReflection/circular-json is the definitive source.
Read full README in the tab above.
Curious whether circular-json is right for you?
Let ChatGPT, Claude, or Perplexity look into it — click below and see what AI actually says about circular-json.