Natural Compare (natural-compare-lite) provides a “natural ordering” string comparison for mixed letters and numbers, so items sort the way humans expect (for example, “img2” comes before “img10”). Use String.naturalCompare with JavaScript sort(), including for sorting arrays of strings or object fields, and it supports configuration for custom alphabets.
Project status
- Actively maintained recently, the most recent upstream push is 2026-09-02 and the repo has a new tagged update v1.4.1 (2026-09-02 20:39:11+00:00).
- Update cadence appears sporadic, there was a long gap after v1.4.0 in 2015, then a new patch update arrived in 2026, so the near-term cadence cannot be inferred beyond this recent burst.
AI summary generated
Recent updates
v1.4.1
Release v1.4.1 is a small patch release focused on fixing issues related to custom alphabet handling. It addresses incorrect custom-alphabet ordering and a hang that could occur when using a custom alphabet.
v1.4.0
v1.4.0 ships with no provided release notes. The diff shows a change to the library entrypoint and distribution build, moving from attaching the comparator to String toward exporting it via CommonJS (with a fallback for non-module environments), and it updates the test and CI setup accordingly.
v1.3.1
This release (v1.3.1) introduces a new implementation of String.naturalCompare in index.js and updates the package layout to make index.js the main entrypoint. The behavior of natural sorting is broadened (decimal fractions, negative numbers, and optional custom alphabet support), and the test suite and README were updated accordingly. No release notes were provided for this version, so changes can only be validated against the code diff.
BreakingFeaturesv0.4
Release v0.4 was published, but the publisher provided no release notes or change log details. No information is available here to assess new features, breaking changes, bug fixes, security, performance, or migration requirements for this version.
v0.3
This release (v0.3) updates the library API to use a camelCase export name, and adjusts the project tooling and tests to match. It also changes some comparison operators inside the natural compare implementation, which can alter results for mixed-type inputs.
Breakingv0.2
Release v0.2 contains build and packaging changes, and a functional change in the comparison logic. The release notes are missing, so the behavior and distribution changes below are inferred directly from the code diff.
Breakingv0.1
This release is tagged v0.1 (published 2013-04-03), but no release notes were provided by the publisher. As a result, there is insufficient information to identify new features, breaking changes, bug fixes, security updates, performance improvements, or migration steps for developers.