0.2.0 • Published 10 years ago

shrub v0.2.0

Weekly downloads
8
License
-
Repository
github
Last release
10 years ago

Shrub

Manipulate lists of files recursively in Node.

Install

npm install shrub --save

Usage

var Shrub = require('shrub');
var shrub = new Shrub('path/to/dir');

shrub.each(function (filePath, stats, next) {
  // Do stuff
  next();
}, function () {
  // complete
});

shrub.filter(function (filePath, stats, next) {
  // Callback a true statement to add this file
  // to the filtered list
  
  next(filePath === 'some/file/path');
}, function (files) {
  // complete
});

Methods

each(filterFn, onComplete)

Asynchronous loop through file tree

filter(filterFn, onComplete)

Aynchronously filter the file tree