Object serialization library
icebox.js serializes object structures, which may be circular, into non-circular structures that can be stored or transmitted. When deserializating such structures, icebox.js re-establish constructor associations and circular links.
$ npm install icebox
Load the module
var icebox = ;
Freeze some data:
var frozen = icebox;
The frozen variable now contains a non-circular, annotated object tree that can be converted to JSON, stored in files or transmitted over a network connection.
Thaw the frozen representation to yield the same circular structure:
var data = icebox;
Whenever an object is restored from the frozen representation, its thawed() function is invoked, if it exists. The thawed() function can be used for bookkeeping, but it must not assume that anything beyond the current object has been thawed() yet.
Icebox tags each object that it serializes with an ID in order to resolve circles. These ids are not available outside of the serialization process, and applications must use their own object IDs, if desired, as icebox needs to have full control over its own ID space.