rad-tree
Small library implementing a radix (or prefix) tree.
Install
npm i --save rad-tree
Usage
Create a tree
'use strict'
const Tree = require('rad-tree')
const tree = new Tree()
Set key/value pairs
...
tree.set('icecream', 'cone')
tree.set('foo', 'bar')
tree.set('iced', 'coffee')
tree.set('foobar', 'baz')
tree.set('ice')
tree.set('fo', 'mo')
Get values
...
tree.get('foobar')
tree.get('icedcoffee')
Delete key/value pairs
...
tree.delete('foobar')
tree.delete('icedcoffee')
Generate object representation of tree
...
tree.toObject()
Generate string representation of tree
...
tree.toString()
Test
npm test
Lint
npm run lint
Documentation
npm run doc
Contributing
Please do!
If you find a bug, want a feature added, or just have a question, feel free to open an issue. In addition, you're welcome to create a pull request addressing an issue. You should push your changes to a feature branch and request merge to develop.
Make sure linting and tests pass and coverage is 💯 before creating a pull request!