Skip to content

ORESoftware/waldo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

835d4f8 · Sep 1, 2018

History

64 Commits
Sep 1, 2018
Jun 24, 2018
May 13, 2018
May 18, 2018
Sep 1, 2018
May 22, 2018
Jun 10, 2018
May 13, 2018
May 13, 2018
May 13, 2018
Jun 11, 2018
May 19, 2018
May 13, 2018
May 17, 2018
Jun 10, 2018
May 13, 2018
Sep 1, 2018
May 13, 2018
Sep 1, 2018
May 13, 2018

Repository files navigation

@oresoftware/waldo

GNU/BSD find kills me sometimes, so I wrote this.

install:

# for command line tools
npm install -g waldo

# for library usage
npm install waldo --save

At the command line:

Basic usage
waldo  ### lists all matching files and dirs in the current working dir
waldo --path="."  ### lists all matching files and dirs, in the current working dir

Note that if you omit the --path arg, it defaults to $PWD/.

waldo --path="." --dirs  ### will not list dirs, -d for short
waldo --path="." --files  ### will not list files, -f for short
waldo --path="." --symlinks  ### will not list symlinks, -s for short
Using matching
waldo --path="." -n /node_modules/   # don't match any path that has /node_modules/ in it

waldo --path="." -n ^/node_modules/   # don't match any path that starts with /node_modules/ 

waldo --path="." -n '\.js$'   # don't match any path ends that with '.js'

waldo --path="." -m '\.js$'   #  match only paths that end that with '.js'

Library Usage

import {WaldoSearch} from '@oresoftware/waldo';

new WaldoSearch({
  
  path,  // the path you which to search
  matchesAnyOf,  // array of strings or RegExp
  matchesNoneOf, // array of strings or RegExp
  dirs,   // list dirs
  files   // list files (true by default)
  
})
.search((err, results) => {

    // results is your array of strings
});

to use with ES6 Promises

=> Use the searchp() method
new WaldoSearch({...}).searchp().then(results => {

    // results is your array of strings
});

About

Because the unix `find` command sucks horribly.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published