# aho-corasick.js

> A Javascript implementation of the Aho-Corasick algorithm

Latest version **0.0.1** (published 2012-12-28) · 0 weekly downloads

## Install

```sh
npm install aho-corasick.js
pnpm add aho-corasick.js
yarn add aho-corasick.js
bun add aho-corasick.js
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2012-12-28 |
| First published | 2012-12-28 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | * |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Tom Booth |
| Maintainers | tombooth |

## Links

- npm: https://www.npmjs.com/package/aho-corasick.js
- npm.io page: https://npm.io/package/aho-corasick.js

## Recent versions

- 0.0.1 (latest) — 2012-12-28

## README

About [![Build Status](https://travis-ci.org/tombooth/aho-corasick.js.png?branch=master)](https://travis-ci.org/tombooth/aho-corasick.js)
-------------------------------------
A Javascript implementation of the [Aho-Corasick algorithm](http://cisc-w09.isrl.kr/cgi-bin/TUBoard/db/seminar/upload/1183356194165246034173/p333-aho-corasick.pdf). It has one difference in that it will return the longest possible match.

Installation
-------------------------------------
```
$ npm install aho-corasick.js
```

Usage
-------------------------------------
```javascript
var AhoCorasick = require('aho-corasick.js'),
    trie = new AhoCorasick.TrieNode();

['ab', 'bcr', 'caa'].forEach(function(word) { trie.add(word, { word: word }); });

AhoCorasick.add_suffix_links(trie);

AhoCorasick.search('foab', trie, function(found_word, data) {
   console.log(found_word, data);
});
```

Links
-------------------------------------
Coffeescript port by @hsujian https://github.com/hsujian/aho-corasick

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