0.0.2 • Published 6 years ago
redstar v0.0.2
redstar 💥
basic file globber
Easy to use
var glob = require( 'redstar' )
glob( 'src/**/*.js', function ( err, files, dirs ) {
if ( err ) {
// any errors e.g. permission EACCES errors etc
err.forEach( function ( err ) {
console.error( err )
} )
}
// all matched files
files.forEach( function ( file ) {
console.log( 'file: ' + file )
} )
// all recursed dirs ( including dirs without any matching files )
dirs.forEach( function ( dir ) {
console.log( 'dir: ' + dir )
} )
} )
About
Simple globber. Ignores **/node_modules/**
, **.git/**
and .hidden
files by default.
Why
Small, quick, and easy -- had some inconsistency problems using other popular alternatives.
How
fs.readdir and minimatch.
Alternatives
Test
npm test