List files in folders using 'glob' syntax and gruntjs 'expand' algorithm.
The normal npm way:
npm install globbit
globbit [OPTIONS] [...MINIMATCH EXPRESSIONS]
Example:
globbit --nosort 'path/**/*.js' '!path/**/*.spec.js'
Options are parsed with minimist, and passed directly to the glob module.
That means --nosort
becomes { nosort: true }
, and --cwd='/path'
becomes { cwd: '/path' }
as options passed to glob
.
You can add as many minimatch expressions as you want. Excluded patterns are
made by putting !
at the start of the expression.
Note: In some OS systems, asterisks will auto-expand before being passed in to this module, when surrounded with double quotes, e.g.
"path/**/*.js
. To prevent this, simply use single quotes in your minimatch expressions.
Each filename is output with process.stdout.write
so you should
be able to pipe the output to any other normal program.
Published and released under the Very Open License.