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

fs-walk-breadth-first

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fs-walk-breadth-first

Call a function on each file in a filesystem tree

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
89
increased by56.14%
Maintainers
1
Weekly downloads
 
Created
Source

node-fs-walk-breadth-first

Call a function on each file in a filesystem tree

Example

var walk = require("fs-walk-breadth-first");
walk(".", function(filename, stats) {
	console.log(filename, stats.isDirectory());
}, function(err) {
	if (err) {
		console.error(err);
		return;
	}
	console.log("finished!");
});

Installation

npm install --save fs-walk-breadth-first

walk(directory, iterator, callback)

Traverses all files and directories beneath directory in breadth-first order. The iterator function is called on each file or directory, and the callback function is called after all files and directories have been visited.

Arguments

  • directory - The directory to traverse.
  • iterator(filename, stats, callback) - A function to apply to each file or directory found. stats is an instance of fs.Stats. callback(err) should be called when the iterator is finished
  • callback(err) - A function that is called when all the files and directories have been visited, or when an error occurs.

Code of Conduct

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

Keywords

FAQs

Package last updated on 15 Jul 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