Skip to content
Like ruby's Abbrev module
Find file
Latest commit 0030c79 @isaacs tap@2
Failed to load latest commit information.
.gitignore gitignore
.travis.yml travis ci file Contributing
LICENSE isc license Initial commit.
abbrev.js Split up main and test scripts, support use_strict
package.json tap@2
test.js update tests for tap with coverage


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.

Something went wrong with that request. Please try again.