# abbrev

> Like ruby's abbrev module, but in js

Latest version **5.0.0** (published 2026-05-08) · ISC license · 0 weekly downloads

## Install

```sh
npm install abbrev
pnpm add abbrev
yarn add abbrev
bun add abbrev
```

## Health

**Score 58/100 (C)** — status: active.

Positive: has types package; no vulnerabilities; has provenance; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 5.0.0 |
| Published | 2026-05-08 |
| First published | 2011-03-21 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | separate (@types/abbrev) |
| Module format | CommonJS |
| Node | ^22.22.2 \|\| ^24.15.0 \|\| >=26.0.0 |
| Dependencies | 0 |
| Unpacked size | 5.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 167 |
| Author | GitHub Inc. |
| Maintainers | saquibkhan, npm-cli-ops, reggi, owlstronaut |

## Links

- npm: https://www.npmjs.com/package/abbrev
- Repository: https://github.com/npm/abbrev-js
- Homepage: https://github.com/npm/abbrev-js#readme
- Issues: https://github.com/npm/abbrev-js/issues
- npm.io page: https://npm.io/package/abbrev

## Recent versions

- 5.0.0 (latest) — 2026-05-08
- 4.0.0 — 2025-10-20
- 3.0.1 — 2025-04-10
- 3.0.0 — 2024-09-24
- 2.0.0 — 2022-11-01
- 1.1.1 — 2017-09-28
- 1.1.0 — 2017-02-14
- 1.0.9 — 2016-06-15
- 1.0.7 — 2015-05-30
- 1.0.6 — 2015-05-21
- 1.0.5 — 2014-04-17
- 1.0.4 — 2013-01-09
- 1.0.3 — 2011-03-21

## 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.

---
_Source: https://npm.io/package/abbrev · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
