# @types/javascript-natural-sort

> TypeScript definitions for javascript-natural-sort

Latest version **0.7.0** (published 2026-02-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/javascript-natural-sort
pnpm add @types/javascript-natural-sort
yarn add @types/javascript-natural-sort
bun add @types/javascript-natural-sort
```

## Health

**Score 60/100 (C)** — status: stable.

Positive: has types; no vulnerabilities; popular repo; extremely popular.

Warnings: low downloads; no esm support; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.7.0 |
| Published | 2026-02-04 |
| First published | 2026-02-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51343 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/javascript-natural-sort
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/javascript-natural-sort
- npm.io page: https://npm.io/package/@types/javascript-natural-sort

## Recent versions

- 0.7.0 (latest) — 2026-02-04

## README

# Installation
> `npm install --save @types/javascript-natural-sort`

# Summary
This package contains type definitions for javascript-natural-sort (https://github.com/Bill4Time/javascript-natural-sort).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/javascript-natural-sort.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/javascript-natural-sort/index.d.ts)
````ts
/**
 * Natural sort comparison function for use with Array.sort().
 * Sorts strings containing numbers in a human-friendly way.
 *
 * @param a - First value to compare
 * @param b - Second value to compare
 * @returns Negative if a < b, positive if a > b, zero if equal
 *
 * @example
 * ```javascript
 * var naturalSort = require('javascript-natural-sort');
 *
 * ['img12', 'img10', 'img2', 'img1'].sort(naturalSort);
 * // => ['img1', 'img2', 'img10', 'img12']
 * ```
 */
declare function naturalSort(a: string | number, b: string | number): number;

declare namespace naturalSort {
    /**
     * Set to true to enable case-insensitive sorting.
     * @default false
     */
    let insensitive: boolean;
}

export = naturalSort;

````

### Additional Details
 * Last updated: Wed, 04 Feb 2026 18:45:32 GMT
 * Dependencies: none

# Credits
These definitions were written by [gaspard](https://github.com/gasp).

---
_Source: https://npm.io/package/@types/javascript-natural-sort · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
