eachfile

7.7.8 • Public • Published

eachfile

Iterate the files of a directory.

var eachfile = require("eachfile");
 
eachfile.in('.', function(stats, next){
    console.log(stats.name, stats.isFile());
    next();
});

Used with the eachline module:

var eachfile = require("eachfile");
var eachline = require("eachline");
 
eachfile.in('./data/', function(stats, next){
 
    process.stdout.write(stats.fullpath);
 
    eachline.in(stats.fullpath, function(line, i){
        if(!line) return;
        //do something
    })
    .on('finish', function () {
        console.log(' ..done');
        next();
    });
 
})
.on('error', function (err) {
    console.trace(err)
});

Install

npm install eachfile

license

MIT

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i eachfile

      Weekly Downloads

      1

      Version

      7.7.8

      License

      MIT

      Last publish

      Collaborators

      • williamkapke