Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fs-recurse

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fs-recurse

Walk through directories asynchronously with callback on each file/folder

  • 0.0.6
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

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

Keywords

FAQs

Package last updated on 23 Mar 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc