fs-sort
fs-sort recursivly finds all files in path and create a list of all of those files orderded by the filter function provided
Installation
$ npm i fs-sort
Get sorted files
Params:
- path - Path to get files from
- ignores - Array of file names to ignore
- sortingFunction - The function that "chooses" what file property to use for sorting. sortingFunction receive the parameter fileObject which is in the form of:
fileName: "Name of the file, including the extension" fileStats: "File stats that dependes on the version of node you are running and the OS" fileFullPath: "Full file path to system root folder"
- callback - A callback in the form of function(err, orderedFileList)
Example:
var fs_sort = var { return fileObjectfileName}
Testing
In order to test you need to install mocha globaly on your machine
$ cd /"module-path"/fs-sort$ mocha
License
MIT