Socket
Book a DemoInstallSign in
Socket

text-tree

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

text-tree

Simple data structure and algorithms for use in tries, suffix trees and the like.

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

textTree

Simple data structure and algorithms for use in tries, suffix trees and the like.

Getting Started

Install the module with: npm install textTree

var textTree = require('text-tree');
var trie = new textTree.trie();
trie.insert('hello world');
trie.insert('hi');
trie.insert('world');
trie.insert('wonderful');
trie.insert('wicked');
trie.autoComplete('wo'); // ['wonderful', 'world']
// Alternatively if you are using client side javascript
<script type="text/javascript" src="text-tree.min.js"></script>
<script type="text/javascript">
var trie = new textTree.trie();
trie.insert('hello world');
trie.insert('hi');
trie.insert('world');
trie.insert('wonderful');
trie.insert('wicked');
console.log(trie.autoComplete('wo')); // ['wonderful', 'world']
</script>

## Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [grunt](https://github.com/gruntjs/grunt).

## License
Copyright (c) 2013 Thomas Holloway  
Licensed under the MIT license.

FAQs

Package last updated on 19 Feb 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts