Skip to content
This repository has been archived by the owner on Aug 23, 2021. It is now read-only.
/ node-find-glob Public archive

Find files using extensive glob syntax

Notifications You must be signed in to change notification settings

Dashlane/node-find-glob

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

find-glob

js-strict-standard-style

Regular find has inconsistent support for extended regex syntax. This replacement uses glob package syntax and will work consistently anywhere your Node works.

// Show js files in the directory
find-glob '**/*.js'

// Run eclint with all files you want to find
find-glob -0 '**/*.js' '**/*.json' '!node_modules/**' | xargs -0 eclint

// Check if your codebase contains TODO notes:
find-glob --contain 'TODO' --fail-on-empty '**/*.js'

// Check that your codebase does NOT contain TODO notes:
find-glob --contain 'TODO' --fail-on-find '**/*.js'

Options

-0 enables a null byte separator, to be used with -0 in xargs.

--contain '^http:' will filter only the files that contain the passed regular expression, which is run in multi-line mode by default, so ^ and $ refer to a line begin and line end.

--fail-on-empty will return an error code if no files have been found.

--fail-on-find will return an error code if files have been found.

About

Find files using extensive glob syntax

Resources

Stars

Watchers

Forks

Packages

No packages published