unsplay

1.0.5 • Public • Published

unsplay

Compute a tree from an array of objects with IDs and parent IDs

Installation

$ npm install unsplay

Usage

>> var unsplay = require('unsplay');
>> unsplay([{id: 0}, {id: 1, pid: 0}], 'id', 'pid');
[{
  item: {id: 0},
  children: [{
    item: {id: 1, pid: 0},
    children: []
  }]
}]

Readme

Keywords

none

Package Sidebar

Install

npm i unsplay

Weekly Downloads

1

Version

1.0.5

License

MIT

Last publish

Collaborators

  • dbkaplun