Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A simple anagram generation library for use with nodejs
JavaScript
branch: master

This branch is 23 commits ahead, 2 commits behind jeresig:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
bin
dict
examples
lib 0.3.0: removed findAnagramsSafely in favor of findAnagrams with and w…
test
.gitignore ignore file updates
.npmignore ignore file updates
Readme.md
index.js First restructure...
package.json

Readme.md

anagram

A simple anagram generation library for use with nodejs. Forked from jeresig/trie-js by John Resig.

Installation

$ npm install anagram

Examples

var anagram = require('anagram');

anagram.init('../dict/twl06.js', function(err) {
    if (err) throw err;
    anagram.findAnagrams('dog', function(err, anagrams) {
        console.log('`%s`: found %d anagrams', anagrams.input, anagrams.count);
        console.log(anagrams);
    });
});

Executables

anagram comes packed with two executables: anagram and anagram-build

$ anagram-build -f dict/twl06.txt > dict/twl06.js

$ anagram -d dict/twl06.js -w anagr?m

Running tests

Install development dependencies:

$ npm install -d

Run the tests:

$ npm test

License

Copyright (c) 2012 Ryan Nauman

MIT Licensed

Something went wrong with that request. Please try again.