📅 You're Invited: Meet the Socket team at RSAC (April 28 – May 1).RSVP
Socket
Sign inDemoInstall
Socket

abbrev

Package Overview
Dependencies
Maintainers
7
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

abbrev

Like ruby's abbrev module, but in js

3.0.1
latest
Source
npm
Version published
Weekly downloads
30M
2.84%
Maintainers
7
Weekly downloads
 
Created

What is abbrev?

The abbrev npm package is used to create a list of unique abbreviations for a given set of strings. It is particularly useful when you need to generate a minimal set of distinct abbreviations for a list of words, ensuring that each word's abbreviation is unambiguous.

What are abbrev's main functionalities?

Generating abbreviations

This feature allows you to generate an object where the keys are all possible unique abbreviations and the values are the full strings that they map to. In the code sample, abbreviations for 'apple', 'ape', and 'april' are generated, resulting in an object with keys like 'a', 'ap', 'app', etc., each pointing to their respective full words.

const abbrev = require('abbrev');
const abbreviations = abbrev('apple', 'ape', 'april');
console.log(abbreviations);

Other packages similar to abbrev

FAQs

Package last updated on 10 Apr 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts