Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

icebox

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

icebox

Object serialization library

  • 0.1.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

icebox.js - A simple 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.

Installation

$ npm install icebox

Usage

Load the module

var icebox = require('icebox');

Freeze some data:

var frozen = icebox.freeze(data);

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.thaw(frozen);

thawed() callback

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.

Additional notes

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.

Keywords

FAQs

Package last updated on 19 Dec 2013

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc