# path-sort

> Sort a list of file/directory paths

Latest version **0.1.0** (published 2013-08-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install path-sort
pnpm add path-sort
yarn add path-sort
bun add path-sort
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2013-08-09 |
| First published | 2013-08-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 15 |
| Author | Hugh Kennedy |
| Maintainers | hughsk |
| Keywords | sort, path, file, directory, tree |

## Links

- npm: https://www.npmjs.com/package/path-sort
- Repository: https://github.com/hughsk/path-sort
- npm.io page: https://npm.io/package/path-sort

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 0.1.0 (latest) — 2013-08-09
- 0.0.0 — 2013-08-07

## README

# path-sort [![stable](http://hughsk.github.io/stability-badges/dist/stable.svg)](http://github.com/hughsk/stability-badges) #

Sort a list of file/directory paths, such that something like this:

``` javascript
[
  'a/world'
, 'a/lib/index.js'
, 'b/package.json'
, 'b/lib/3/index.js'
, 'b/lib/2/README.js'
, 'a/hello'
, 'b/lib/2/index.js'
, 'a/lib/README.md'
, 'b/lib/3/README.js'
, 'c'
]
```

Becomes something like this:

``` javascript
[
  'a/hello'
, 'a/world'
, 'a/lib/index.js'
, 'a/lib/README.md'
, 'b/package.json'
, 'b/lib/2/index.js'
, 'b/lib/2/README.js'
, 'b/lib/3/index.js'
, 'b/lib/3/README.js'
, 'c'
]
```

## Installation ##

``` bash
npm install path-sort
```

## Usage ##

### `require('path-sort')(files[, sep])` ###

Takes an array of `filenames` with an optional delimiter (`sep`), returning a
sorted copy.

### `require('path-sort').standalone([sep])` ###

Returns a `Array.prototype.sort`-friendly method. It's a little slower but
easier to use in some cases.

``` javascript
var sorter = require('path-sort').standalone('/')

array = array.sort(sorter)
```

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