0.5.0 • Published 10 years ago

nrtv-tree v0.5.0

Weekly downloads
24
License
-
Repository
-
Last release
10 years ago

This library is useful if you want to ask some questions about a tree structure.

var Tree = require("nrtv-tree")
var tree = new Tree()

You just provide a string and then an array of strings that identify that string's children.

tree.add("Linda", ["Susan"])
tree.add("Susan", ["Jennifer"])
tree.add("Jennifer", ["Madison"])

tree.ancestors("Madison") 

# returns ["Linda", "Susan", "Jennifer"]

It's sort of different from other similar libraries in that it's only a tree of identifiers, so if you add the same one in two places, that's considered the same node.

0.5.0

10 years ago

0.4.0

10 years ago

0.3.0

10 years ago

0.2.0

10 years ago

0.1.0

10 years ago