This package has been deprecated

Author message:

no longer supported given more active repositories with same functionality

recycler

0.0.7 • Public • Published

Recycler

A NodeJS library for "decyling" and "recycling" cyclic Javascript objects. It can also be used for replacing all object references with ids so that layzy loading and streaming can be implemented.

For an alternative approach, if you only need to serialize and don't need object references for the nested objects see: https://github.com/WebReflection/circular-json.

Please help us improve this code by submitting issues at https://github.com/anywhichway/recycler/issues

Usage

See the documentation in the source code for now. Although, here is a simple example:

var recycler = new Recycler();

var object1 = {id: 1};

var object2 = {id: 2};

object1.cyclic = object2;

object2.cyclic = object1;

var map = {};

var d = recycler.decycle(object1,map);

recycler.recycle(d,map);

will result in d having the same data structure as object1.

There is no npm registry package yet. You can run the command:

npm install git+http://github.com/anywhichway/recycler.git

And, add this dependency to you package.json file for now.

"dependencies": { "recycler": "git+http://github.com/anywhichway/recycler.git" }

Developing

Tools

Created with Nodeclipse (Eclipse Marketplace, site)

Nodeclipse is free open-source project that grows with your contributions.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Published

Version History

  • Version
    Downloads (Last 7 Days)
    • Published

Package Sidebar

Install

npm i recycler

Weekly Downloads

0

Version

0.0.7

License

none

Last publish

Collaborators

  • anywhichway