# digits-trie

> Fast prefix operations for strings of digits

Latest version **1.0.0** (published 2015-10-10) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install digits-trie
pnpm add digits-trie
yarn add digits-trie
bun add digits-trie
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2015-10-10 |
| First published | 2015-10-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Abdullah Alansari |
| Maintainers | ahimta |
| Keywords | trie, digits, phone, prefix |

## Links

- npm: https://www.npmjs.com/package/digits-trie
- Repository: https://github.com/Ahimta/digits-trie
- Homepage: https://github.com/Ahimta/digits-trie#readme
- Issues: https://github.com/Ahimta/digits-trie/issues
- npm.io page: https://npm.io/package/digits-trie

## Recent versions

- 1.0.0 (latest) — 2015-10-10

## README

# digits-trie [![Build Status](https://travis-ci.org/Ahimta/digits-trie.svg?branch=master)](https://travis-ci.org/Ahimta/digits-trie)
Fast prefix operations for strings of digits

## Installation

### Bower
```bash
bower install --save digits-trie
```

```js
var Trie = window.DigitsTrie;
```

### NPM
```bash
npm install --save digits-trie
```

```js
var Trie = require('digits-trie');
```

## Usage
The main goal of digits-trie is to provide fast prefix operations for strings of digits.
As of now it has a limited set of features. If you want a feature to be added, open an issue and explain your usecase.

Not that all keys have to be strings of digits, otherwise an exception will be thrown.

### Usage example
```js
var trie = new Trie();

trie.set('966', 'sa');

var node = trie.get('966');
node.value === 'sa';
node.key === '966';

trie.longestMatchingPrefix('966501245687') === node;

var emptyNode = trie.get('1234');
emptyNode.isNil === true;
emptyNode.value === '';
emptyNode.key === '';
```

---
_Source: https://npm.io/package/digits-trie · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
