Stringy.js will stringify your circular JS objects without complaint.
JavaScript
Switch branches/tags
Nothing to show
Permalink
Failed to load latest commit information.
lib Stringifying should be simpler Mar 5, 2015
package.json initial commit. Mar 11, 2012
readme.md initial commit. Mar 11, 2012

readme.md

Stringy.js

Stringy.js will stringify your circular JS objects without complaint. Unfortunately it currently fails if the object hierarchy exceeds 30 total items.

Usage

var b = {foo: {bar: null}}

b.foo.bar = b // it's circular!

console.log("Filtering: ", b)
console.log(stringy.stringify(b)) // works!
console.log(JSON.stringify(b)) // exception