https://github.com/npm/abbrev-js
Like ruby's Abbrev module
https://github.com/npm/abbrev-js
npm-cli
Last synced: about 2 months ago
JSON representation
Like ruby's Abbrev module
- Host: GitHub
- URL: https://github.com/npm/abbrev-js
- Owner: npm
- License: other
- Created: 2010-03-09T21:16:26.000Z (over 15 years ago)
- Default Branch: main
- Last Pushed: 2025-04-10T13:58:10.000Z (3 months ago)
- Last Synced: 2025-04-10T14:56:57.049Z (3 months ago)
- Topics: npm-cli
- Language: JavaScript
- Homepage:
- Size: 99.6 KB
- Stars: 166
- Watchers: 11
- Forks: 31
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
- Security: SECURITY.md
Awesome Lists containing this project
README
# abbrev-js
Just like [ruby's Abbrev](http://apidock.com/ruby/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.