Socket
Socket
Sign inDemoInstall

directory-search

Package Overview
Dependencies
0
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    directory-search

Recursively search a directory and return a list of files with matching extension.


Version published
Weekly downloads
356
increased by2.89%
Maintainers
1
Install size
4.93 kB
Created
Weekly downloads
 

Readme

Source

You probably want to use node-glob: https://github.com/isaacs/node-glob

If not, here's a smaller, more limited directory search plugin for you.

Recursively search a directory and return a list of matching files. Currently searches only by matching file extension.

Usage

var dirSearch = require('directory-search');

// Search 'public' directory for '.css' files.
dirSearch('public', '.css', function(err, results) {
  if (err) throw err;
  console.log(results);
});

Will result in an array that looks something like this:

[ 'public/styles/app.css',
  'public/styles/tables.css',
  'public/styles/home/login.css' ]

Keywords

FAQs

Last updated on 02 Feb 2014

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc