Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

directory-search

0.0.32 • Public • Published

node-directory-search

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

none

install

npm i directory-search

Downloadsweekly downloads

52,262

version

0.0.32

license

none

last publish

collaborators

  • avatar
Report a vulnerability