node-filelist
Get a list of the absolute path in the file location. This plugin reading all the files in a folder recursively.
Last updated 9 years ago by tea3gt .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install node-filelist 
SYNC missed versions from official npm registry.

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

option description default
ext Extension of the file you want to read. all file
isStats If you want stats in results. false

Results

results description
path The path of the file that you have read .
stats The stats of the file that you have read .

License

MIT

Current Tags

  • 1.0.0                                ...           latest (9 years ago)

2 Versions

  • 1.0.0                                ...           9 years ago
  • 0.0.1                                ...           10 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (0)
None
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |