0.3.3 • Published 1 year ago

finder-sort v0.3.3

Weekly downloads
3
License
ISC
Repository
github
Last release
1 year ago

Sort file names in order meaningful for humans (inspired by OSX Finder).

So cat9.jpg comes before cat10.jpg, it's case insensitive except as tie-breaker, is aware of multi-part paths and so on.

Installation

    npm install finder-sort

Usage

    import finderSort from "finder-sort";

    finderSort(arrayOfFiles);

For more complex scenacios, you can pass key function as second argument. For example if you want to sort array of objects by their fileName property, you can do:

    import finderSort from "finder-sort";

    finderSort(arrayOfObjects, (obj) => obj.fileName);
0.3.2

1 year ago

0.3.1

1 year ago

0.3.3

1 year ago

0.3.0

4 years ago

0.2.0

4 years ago

0.1.0

5 years ago