Socket
Socket
Sign inDemoInstall

findit

Package Overview
Dependencies
Maintainers
0
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

findit

Walk a directory tree.


Version published
Weekly downloads
105K
increased by6.52%
Maintainers
0
Weekly downloads
 
Created
Source

findit

Recursively walk directory trees. Think /usr/bin/find.

example time!

callback style

require('findit').find(__dirname, function (file) {
    console.log(file);
})

emitter style

var finder = require('findit').find(__dirname);

finder.on('directory', function (dir) {
    console.log(dir + '/');
});

finder.on('file', function (file) {
    console.log(file);
});

synchronous

var files = require('findit').findSync(__dirname);
    console.dir(files);

methods

find(basedir)

find(basedir, cb)

Do an asynchronous recursive walk starting at basedir. Optionally supply a callback that will get the same arguments as the path event documented below in "events".

If basedir is actually a non-directory regular file, findit emits a single "file" event for it then emits "end".

Returns an EventEmitter. See "events".

findSync(basedir)

Return an array of files and directories from a recursive walk starting at basedir.

events

file: [ file, stat ]

Emitted for just files which are not directories.

directory : [ directory, stat ]

Emitted for directories.

path : [ file, stat ]

Emitted for both files and directories.

end

Emitted when the recursive walk is done.

Keywords

FAQs

Package last updated on 17 Jun 2011

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