New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

findfiles

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

findfiles

Simple file finder with regexp filters

latest
Source
npmnpm
Version
0.1.6
Version published
Weekly downloads
10
900%
Maintainers
1
Weekly downloads
 
Created
Source

FindFiles.js

A simple file and directory finder.

Installation

$ npm install commander

Example

var ff = require("findfiles");

ff.findFiles("c:\\temp", [/.*\.png/,/.*\.jpg/], function(path, err, dirs, files) {
	console.log("Directories found:");
	console.log(dirs);
	console.log("Files found:");
	console.log(files);
}

Methods

findFiles(path, filter, onComplete)
	
	- path
		The path to traverse
		
	- filter
		null,		To return all directories and files.
		regexp[]	Array or regexp criterias to filter the wanted files (this filters on full path)
		
	- onComplete
		function(path, error, directores, files)
			- path
				The path that was executed
				
			- error
				Contains information if error occurred
				Null, on success
				
			- directories
				An array of all the directories found
				
			- files
				The files found

Known issues

  • While the filter works on the full path of a file, it doesn't filter on the directories. Filter should be changed to one of these. - filter only on file name - have a directory filter and a file filter - remove directories that contains no valid file

  • Cannot enter a single regexp at this time, only array of regexp

Keywords

find

FAQs

Package last updated on 21 May 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