Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/oresoftware/waldo
Because the unix `find` command sucks horribly.
https://github.com/oresoftware/waldo
command-line-tool find nodejs unix-utilities waldo
Last synced: 3 days ago
JSON representation
Because the unix `find` command sucks horribly.
- Host: GitHub
- URL: https://github.com/oresoftware/waldo
- Owner: ORESoftware
- License: mit
- Created: 2018-05-08T17:55:25.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-09-04T01:06:57.000Z (over 6 years ago)
- Last Synced: 2024-10-11T16:11:16.868Z (2 months ago)
- Topics: command-line-tool, find, nodejs, unix-utilities, waldo
- Language: TypeScript
- Homepage:
- Size: 54.7 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# @oresoftware/waldo
GNU/BSD `find` kills me sometimes, so I wrote this.
### install:
```bash
# for command line tools
npm install -g waldo# for library usage
npm install waldo --save```
### At the command line:
##### Basic usage
```bash
waldo ### lists all matching files and dirs in the current working dir
``````bash
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/.`
```bash
waldo --path="." --dirs ### will not list dirs, -d for short
``````bash
waldo --path="." --files ### will not list files, -f for short
``````bash
waldo --path="." --symlinks ### will not list symlinks, -s for short
```##### Using matching
```bash
waldo --path="." -n /node_modules/ # don't match any path that has /node_modules/ in itwaldo --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
```js
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
```js
new WaldoSearch({...}).searchp().then(results => {// results is your array of strings
});```