tree: 0d4b83adf1a8388b3eb5faabac82a72898a46c04 [path history] [tgz]
  1. .npmignore
  2. .travis.yml
  3. abbrev.js
  4. CONTRIBUTING.md
  5. LICENSE
  6. package.json
  7. README.md
  8. test.js
node_modules/abbrev/README.md

abbrev-js

Just like ruby's Abbrev.

Usage:

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.