Cow provides a completely transparent copy on write proxy to deep, cyclic
js objects.
Installation
$ npm install cow
usage
Also note that the copy correctly preserves the objects inheritance and
hidden/accessor properties.
function Test() { this.child = {}; }var obj = new Test(); // provided a normal js object, whichobj.child.obj = obj; // can contain cyclesobj.child2 = obj.child // and referencesvar cow = new Cow(obj);var proxy = cow.proxy;// the proxy has all the properties of obj!proxy.child.obj === proxy;proxy.child2 === proxy.child;// we can write new propertiesproxy.child3 = proxy; // even create new cycles!// convert the proxy back to plain object:var finished = cow.finish