7.7.8 • Published 9 years ago
eachfile v7.7.8
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