lazy-fs
v0.2.0
Published
Extension to add functional syntax to the file system. Use Lazy.js https://github.com/dtao/lazy.js under the hood.
Downloads
3
Readme
lazy-fs
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);
});