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
- The repository appears actively maintained, with a recent upstream push on 2026-07-25, and the last published package update being v4.1.0 on 2025-09-11 (well within the last year of today, 2026-08-13).
- Update cadence is relatively low but ongoing, with a major change in 2021 (v4.0.0), then a feature update in 2025 (v4.1.0). There is not evidence here of frequent releases in between.
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.
Breakingv3.0.0
v3.0.0 introduces a major runtime requirement and adds developer-facing improvements. It breaks compatibility by requiring a newer Node.js version, while also improving performance and shipping TypeScript type definitions.
BreakingFeatures