This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

fs-recurse

0.0.6 • Public • Published

fs-recurse

Walk through directories asynchronously, with callback on each file/folder and ignore option

Usage

npm install fs-recurse

Signature

recurse(String path, Function callback, Function done, Array ignore);

Arguments

  1. path String

    Path in which you want to recurse

  2. callback Function

    Receives four arguments :

    • path String current path
    • filename String current file name
    • type String file extension or 'folder'
    • cursor Function call this function after executing any async operation on current file
  3. done Function

    Invoked when recursion is done

  4. ignore Array

    Anymatch compatible filters...

Example

var recurse = require('./fs-recurse');

recurse('test', function(path, filename, type, cursor){
	fs.stat(path + '/' + file, function(err, stats){
		cursor();
		// Do async operation on files ...
	});
}, function(){
	console.log('Done!');
}, [/\.txt$/, 'index.html']);
// *.txt and index.html will be ignored

Package Sidebar

Install

npm i fs-recurse

Weekly Downloads

0

Version

0.0.6

License

WTFPL

Last publish

Collaborators

  • npm