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' ]

/directory-search/

    Package Sidebar

    Install

    npm i directory-search

    Weekly Downloads

    487

    Version

    0.0.32

    License

    MIT

    Last publish

    Collaborators

    • marshallswain