path-sort
Sort a list of file/directory paths
Last updated 7 years ago by hughsk .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install path-sort 
SYNC missed versions from official npm registry.

path-sort stable

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

[
  '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:

[
  '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

npm install path-sort

Usage

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

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

Current Tags

  • 0.1.0                                ...           latest (7 years ago)

2 Versions

  • 0.1.0                                ...           7 years ago
  • 0.0.0                                ...           7 years ago

Copyright 2014 - 2016 © taobao.org |