tree-operations

create a tree from an array of objects or a flat array from tree, and others operations on tree

Usage no npm install needed!

<script type="module">
  import treeOperations from 'https://cdn.skypack.dev/tree-operations';
</script>

README

tree-operations

build version package dependencies minified linter tests license hits

The lastest version of this document is available on Github > tree-operations

Availables operations

  • fromArray : create a tree from an array of objects
  • toFlatArray : create a flat list from an tree
  • find : find a node in a tree
  • selectNew : filters the properties of the nodes of the tree
  • orderBy : order the leaves of the tree respecting the structure of the tree

Installation

npm install tree-operations --save

or

yarn add tree-operations --save

prerequisites

for NodeJs

 var TreeOps=require("tree-operations");

for browser

<script src="node_modules/find-polyfill/distrib/find-polyfill.min.js"></script>

<script src="node_modules/tree-operations/distrib/tree-operations.min.js"></script>