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

folder-walker

Package Overview
Dependencies
Maintainers
4
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

folder-walker

A recursive stream of the files and directories in a given folder

  • 3.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
130K
increased by10.04%
Maintainers
4
Weekly downloads
 
Created
Source

folder-walker

A recursive stream of the files and directories in a given folder. Can take multiple folders.

build status dat

Install

npm install folder-walker

Example

var walker = require('folder-walker')
var stream = walker(['/path/to/folder', '/another/folder/here'])
stream.on('data', function (data) {
  console.log(data)
})

Example item in the stream:

{
  basename: 'index.js',
  relname: 'test/index.js',
  root: '/Users/karissa/dev/node_modules/folder-walker',
  filepath: '/Users/karissa/dev/node_modules/folder-walker/test/index.js',
  stat: [fs.Stat Object],
  type: 'file' // or 'directory'
}

API

stream = walker(dirs, [opts])

Create a readable object stream of all files and folders inside of dirs.

dirs can be a path to a directory or an array of paths to directories.

opts includes:

{
  fs: require('fs'), // the fs interface to use
  maxDepth: Infinity // maximum folder depth to walk. Minimum depth is 1.
  filter: function (filename) { return true } // a function that lets you filter out files by returning false
  // filter is applied to the `dirs` argument, and every file that folder-walker finds
}

Keywords

FAQs

Package last updated on 11 Sep 2018

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