# finder-on-steroids

> Recursively find and filter files and folders in a directory.

Latest version **1.0.3** (published 2018-06-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install finder-on-steroids
pnpm add finder-on-steroids
yarn add finder-on-steroids
bun add finder-on-steroids
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2018-06-18 |
| First published | 2014-04-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 17.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | James Newell |
| Maintainers | jameslnewell |
| Keywords | fs, readdir, recursive, directory, filter, finder, file, walk, find, tree, traversal |

## Links

- npm: https://www.npmjs.com/package/finder-on-steroids
- Repository: https://github.com/jameslnewell/finder-on-steroids
- Issues: jameslnewell/finder-on-steroids
- npm.io page: https://npm.io/package/finder-on-steroids

## Dependencies (3)

- [minimatch](https://npm.io/package/minimatch.md) ^3.0.3
- [@types/minimatch](https://npm.io/package/@types/minimatch.md) ^3.0.3
- [readdir-on-steroids](https://npm.io/package/readdir-on-steroids.md) ^1.1.2

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 1.0.3 (latest) — 2018-06-18
- 0.2.0 (0.2.0) — 2014-10-17
- 1.0.2 — 2018-06-07
- 1.0.1 — 2018-06-06
- 1.0.0 — 2018-06-06
- 0.4.0 — 2017-01-05
- 0.3.2 — 2014-12-19
- 0.3.0 — 2014-10-17
- 0.3.1 — 2014-10-17
- 0.1.0 — 2014-04-05

## README

# finder-on-steroids

Recursively find and filter files and folders in a directory.

[![CircleCI](https://circleci.com/gh/jameslnewell/readdir-on-steroids.svg?style=svg)](https://circleci.com/gh/jameslnewell/readdir-on-steroids)

## Installation

```bash
npm install --save finder-on-steroids
```

## Usage

```js
import finder from "../src";

const directory = process.argv[4] || ".";

finder(directory)
  .files()
  .depth(1)
  .name("*.ts")
  .find()
  .then(
    files => {
      console.log("\n  Found " + files.length + " TypeScript files:");
      console.log("   - " + files.sort().join("\n   - ") + "\n");
    },
    error => console.error(error)
  );
```

## API

### `finder(directory: string): Finder`

Create a new finder object.

### `.files(): Finder`

Restrict results to contain only files as identified by `fs.Stat.isFile()`.

### `.directories(): Finder`

Restrict results to contain only directories identified by `fs.Stat.isDirectory()`.

### `.depth(max: number) : Finder`

### `.depth(min: number, max: number) : Finder`

Restrict results to contain only paths up to a specific depth.

### `.name(pattern: string|RegExp): Finder`

Restrict results to contain only files and directories with base names that match the specified pattern. Takes a glob string or a RegExp.

### `.path(pattern: string|RegExp): Finder`

Restrict results to contain only files and directories with dir names that match paths that match the specified pattern. Takes a glob string or RegExp.

### `.size(max: number) : Finder`

### `.size(min: number, max: number) : Finder`

Restrict results to contain only files and directories of size within the specified range.

### `.include(filter: string | RegExp | (path: string, stats: Stats) => boolean): Finder`

Restrict results to contain only files and directories according to a custom filter function.

### `.exclude(filter: string | RegExp | (path: string, stats: Stats) => boolean): Finder`

Restrict results to contain only files and directories according to a custom filter function.

### `.find(): Promise<string[]>`

Start finding files.

## License

The MIT License (MIT)

Copyright (c) 2014 James Newell

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