natural-compare
npmv1.4.0Compare strings containing a mix of letters and numbers in the way a human being would in sort order.
Not recommended for new projects
No — natural-compare should not be adopted for new projects. Last published 3701 days ago.
- ?Adoption: grade ?, Not reported by this registry.
No download data reported for this package yet.
- FMaintenance: grade F, Failing.
Last published 3701 days ago.
- AWeight: grade A, Excellent.
Zero runtime dependencies.
- BSupply chain: grade B, Good.
This package has a single maintainer (bus factor of 1).
- ALicense: grade A, Excellent.
MIT — permissive, with no copyleft found in the dependency tree.
Grades are computed deterministically from registry metadata collected by PackageGraph — downloads, dependents, publish dates, the resolved dependency tree, maintainer count, and declared licenses. No third-party scores are used.
Install cost
What you actually take on by adding natural-compare to a project.
Runtime packages this one declares itself.
Distinct packages in the full runtime tree, deduplicated the way a package manager would.
Unpacked size of this package plus its entire runtime tree.
Longest resolved dependency chain below this package.
Compatibility
- Node.js
- No constraint declared
- Module format
- CommonJS only
- TypeScript
- No bundled types
- Install scripts
- None
Quick start
A usage example from the natural-compare README.
<script src=min.natural-compare.js></script>natural-compare vs the alternatives
Packages solving a similar problem in the npm ecosystem, compared on the signals that drive an adoption decision.
| Package | Weekly downloads | Dependents | License | Last release |
|---|---|---|---|---|
| natural-comparethis page | 0 | 3 | MIT | 10 years ago |
| leven | 0 | 2 | MIT | 1 day ago |
| strip-bom | 0 | 1 | MIT | 1 day ago |
| escape-string-regexp | 316.5M | 8 | MIT | 1 day ago |
| is-glob | 137.4M | 3 | MIT | 1 day ago |
| diff | 124.1M | 4 | BSD-3-Clause | 1 day ago |
Dependencies
Declared by natural-compare v1.4.0. Runtime dependencies are installed with the package; dev dependencies are not.
Dev (2)
Used by
Popular packages that depend on natural-compare.
Relationship graph
Dependencies (left) and dependents (right) of natural-compare.
Frequently installed together
Runtime typescript and ESM support for Node.js
Constants and utilities about visitor keys to traverse AST.
Escape RegExp special characters
TypeScript definitions for estree
An AST-based pattern checker for JavaScript.
Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet
A lightweight cache for file metadata, ideal for processes that work on a specific set of files and only need to reprocess files that have changed since the last run
Prettier is an opinionated code formatter
Helper utilities for creating ESLint configuration
ECMAScript parsing infrastructure for multipurpose analysis
deterministic JSON.stringify() with custom sorting to get deterministic hashes from stringified results, with no public domain dependencies
Packs ECMAScript/CommonJs/AMD modules for the browser. Allows you to split your codebase into multiple bundles, which can be loaded on demand. Supports loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.
Release history
No releases in the last two years.
| Version | Published | Size | License |
|---|---|---|---|
| 1.4.0latest | 10 years ago | — | MIT |
| 1.2.2 | 11 years ago | — | MIT |
Overview
natural-compare is an npm package that compare strings containing a mix of letters and numbers in the way a human being would in sort order. It has 3 known dependents in the graph. The latest version is 1.4.0, released under the MIT license.
Who should use it
Teams working in the npm ecosystem who need compare strings containing a mix of letters and numbers in the way a human being would in sort order and value a focused solution.
When not to use it
Consider an alternative if you need to have first-class TypeScript types out of the box, or if a more actively-maintained option better fits your npm stack.
Pros
- Clear open-source license (MIT).
- Lean dependency tree (2 direct dependencies).
Cons
- No bundled TypeScript types (may require a separate @types package).
Auto-generated from collected registry metadata. No external claims are inferred.
Maintainers
Frequently asked questions
Should I use natural-compare?
No — natural-compare should not be adopted for new projects. Last published 3701 days ago.
How do I install natural-compare?
Run `npm install natural-compare` to add natural-compare to your npm project.
What license is natural-compare released under?
natural-compare is distributed under the MIT license.
How popular is natural-compare?
npm does not publish download counts. Within PackageGraph's crawl, 3 known packages depend on natural-compare.
Is natural-compare still maintained?
The most recent release of natural-compare (v1.4.0) was published 10 years ago.
Does natural-compare run install scripts?
No. natural-compare does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.