The leven npm module measures the difference between two strings using the Levenshtein distance algorithm with a fast JavaScript implementation. It also provides a closestMatch helper to find the nearest matching string from an array of candidates, with an optional maxDistance threshold for performance and match filtering.
Project status
- Maintenance status: The GitHub upstream shows a recent push on 2026-07-25, and the last published update (v4.1.0) is from 2025-09-11, which suggests the source is still maintained rather than dormant.
- Update cadence: Tag cadence is relatively infrequent (notable gaps between v4.0.0 in 2021 and v4.1.0 in 2025), but there has been ongoing repository activity in mid-2026.
AI summary generated
Recent updates
v4.1.0
v4.1.0 adds a new named export, closestMatch, for finding the best Levenshtein match from a candidate list. It also introduces a maxDistance option on the main leven function, using early termination to avoid unnecessary distance calculations.
Featuresv4.0.0
v4.0.0 is a major release that converts the package to ECMAScript modules (ESM) and increases the minimum supported Node.js version. The core Levenshtein implementation is largely unchanged, but the module format, TypeScript typings, and package.json packaging settings were updated to match the ESM transition.
Breakingv3.1.0
v3.1.0 focuses on improving CommonJS and TypeScript interoperability. The release notes only mention a TypeScript definition refactor to be CommonJS compatible, but the diff shows additional runtime and typing-compat changes around how default exports are represented.
Breaking