Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    eachfilepublic

    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

    install

    npm i eachfile

    Downloadsweekly downloads

    5

    version

    7.7.8

    license

    MIT

    repository

    githubgithub

    last publish

    collaborators

    • avatar