Like ruby's Abbrev module
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
.travis.yml travis ci file Jun 3, 2015 Contributing Feb 12, 2013
LICENSE isc license May 21, 2015 Initial commit. Mar 9, 2010
abbrev.js Split up main and test scripts, support use_strict Apr 17, 2014
package.json v1.0.9 Jun 15, 2016
test.js update tests for tap with coverage May 30, 2015


Just like ruby's Abbrev.


var abbrev = require("abbrev");
abbrev("foo", "fool", "folding", "flop");

// returns:
{ fl: 'flop'
, flo: 'flop'
, flop: 'flop'
, fol: 'folding'
, fold: 'folding'
, foldi: 'folding'
, foldin: 'folding'
, folding: 'folding'
, foo: 'foo'
, fool: 'fool'

This is handy for command-line scripts, or other cases where you want to be able to accept shorthands.