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

findit2

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

findit2

walk a directory tree recursively with events

  • 2.2.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
567K
decreased by-2.88%
Maintainers
1
Weekly downloads
 
Created

What is findit2?

The findit2 npm package is a utility for recursively finding files and directories within a given directory. It is useful for tasks such as searching for specific files, filtering files by certain criteria, and performing actions on files or directories as they are found.

What are findit2's main functionalities?

Finding all files in a directory

This feature allows you to find all files within a specified directory. The code sample demonstrates how to use the 'file' event to log each file found.

const findit = require('findit2');
const finder = findit('/path/to/dir');
finder.on('file', (file, stat) => {
  console.log('File: ' + file);
});

Finding all directories in a directory

This feature allows you to find all directories within a specified directory. The code sample demonstrates how to use the 'directory' event to log each directory found.

const findit = require('findit2');
const finder = findit('/path/to/dir');
finder.on('directory', (dir, stat) => {
  console.log('Directory: ' + dir);
});

Filtering files by extension

This feature allows you to filter files by their extension. The code sample demonstrates how to log only '.txt' files found in the specified directory.

const findit = require('findit2');
const finder = findit('/path/to/dir');
finder.on('file', (file, stat) => {
  if (file.endsWith('.txt')) {
    console.log('Text file: ' + file);
  }
});

Other packages similar to findit2

Keywords

FAQs

Package last updated on 18 Oct 2014

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