lazy-fs
file system · javascript · node.js

lazy-fs

Gitter

Build Status

Extension to add to file system functional syntax. Lazy.js under the hood.

Installation

$ npm install lazy-fs --save

Example


var lazyfs = require('lazy-fs');

/**
 * get all 'model.js' in ./modules folder and instantiate them with config
 */

lazyfs.dir(path.join(__dirname, 'modules'))
    .filter(lazyfs.isFile)
    .filter(function(file) {
        return file.name === 'model.js';
    ))
    .each(function(model) {
        //instantiate model
        require(model.path)(config);
    });