nf

node-filelist

Get a list of the absolute path in the file location. This plugin reading all the files in a folder recursively.

Showing:

Popularity

Downloads/wk

548

GitHub Stars

6

Maintenance

Last Commit

4yrs ago

Contributors

1

Package

Dependencies

1

Size (min+gzip)

8.9KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

node-filelist

Get a list of the absolute path in the file location. This plugin reading all the files in a folder recursively.

Installation

$ npm install node-filelist --save

Usage

For example. If you want to read the image file.

var fl      = require('node-filelist');
var files   = [ "/path-you-want-to-read" ];
var option  = { "ext" : "jpeg|jpg|png|gif" };

fl.read(files, option , function (results){
    for(var i=0; i<results.length; i++){
      console.log(results[i].path);
      //console.log(results[i].stats.mtime);    // If you want stats.mtime , option.isStats should set true.
    }
});

It will be in the following such a results.

/path-you-want-to-read/sample-1.jpg
/path-you-want-to-read/example-dir/sample-2.jpg
/path-you-want-to-read/sample-3.png
/path-you-want-to-read/sample-4.gif
...

Option

optiondescriptiondefault
extExtension of the file you want to read.all file
isStatsIf you want stats in results.false

Results

resultsdescription
pathThe path of the file that you have read .
statsThe stats of the file that you have read .

License

MIT

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100