# pattern-file-search

> ![Travis CI Status](https://travis-ci.org/icfolson/pattern-file-search.svg?branch=master)

Latest version **0.2.1** (published 2016-10-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install pattern-file-search
pnpm add pattern-file-search
yarn add pattern-file-search
bun add pattern-file-search
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.1 |
| Published | 2016-10-31 |
| First published | 2015-11-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | dmenssen |

## Links

- npm: https://www.npmjs.com/package/pattern-file-search
- Repository: https://github.com/icfolson/pattern-file-search
- Homepage: https://github.com/icfolson/pattern-file-search#readme
- Issues: https://github.com/icfolson/pattern-file-search/issues
- npm.io page: https://npm.io/package/pattern-file-search

## Dependencies (1)

- [async](https://npm.io/package/async.md) ^1.5.0

## Recent versions

- 0.2.1 (latest) — 2016-10-31
- 0.2.0 — 2015-12-01
- 0.1.0 — 2015-11-09

## README

# Pattern File Search

![Travis CI Status](https://travis-ci.org/icfolson/pattern-file-search.svg?branch=master)

Recursively searches a directory for files matching a pattern, optionally
ignoring a pattern.

## FAQ

### Why would I use this instead of jergason/recursive-read-dir

1. We have inclusive pattern matching. Use this to do things like "find all the
javascript files in this directory"
2. Our comments don't say ["woop woop"](https://github.com/jergason/recursive-readdir/blob/master/index.js#L36), like a Juggalo
3. We have a depencency on caolan/async, so your build will be more robust
(read: larger, bloated)

### What exactly do the patterns match?

The include pattern matches only the filename. The exclude pattern matches the
filename, or any directory in the path (but only one path segment at a time).

## Usage

    // List everything
    var fileList = require('pattern-file-search')
    fileList('/some/base/directory', function(err, list) {
    	// boom
    })

    // List everything matching pattern
    fileList('/some/base/directory', /pattern.to.match/, function(err, list) {
    	// boom
    })

    // Exclude files matching pattern
    fileList('/some/base/directory', /pattern.to.match/, /pattern.to.exclude/, function(err, list) {
    	// boom
    })

---
_Source: https://npm.io/package/pattern-file-search · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
