# find-project-files

> finds files in a directory that are not ignored by .gitignore files in the filesystem

Latest version **0.0.4** (published 2019-01-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install find-project-files
pnpm add find-project-files
yarn add find-project-files
bun add find-project-files
```

## 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.0.4 |
| Published | 2019-01-01 |
| First published | 2018-08-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8 |
| Dependencies | 4 |
| Unpacked size | 121.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Mike Bannister |
| Maintainers | possibilities |

## Links

- npm: https://www.npmjs.com/package/find-project-files
- npm.io page: https://npm.io/package/find-project-files

## Dependencies (4)

- [ignore](https://npm.io/package/ignore.md) ^5.0.1
- [fs-extra](https://npm.io/package/fs-extra.md) ^7.0.0
- [invariant](https://npm.io/package/invariant.md) ^2.2.4
- [klaw-sync](https://npm.io/package/klaw-sync.md) ^4.0.0

## Recent versions

- 0.0.4 (latest) — 2019-01-01
- 0.0.3 — 2018-08-22
- 0.0.2 — 2018-08-15
- 0.0.1 — 2018-08-15

## README

# Find project files [![CircleCI](https://circleci.com/gh/possibilities/find-project-files.svg?style=svg)](https://circleci.com/gh/possibilities/find-project-files)

Finds files in a directory that are not ignored by `.gitignore` files in the filesystem

## Usage

#### `findProjectFiles(rootPath: string, globalIgnorePatterns = [])`

```javascript
const findProjectFiles = require('find-project-files')

const files = findProjectFiles('/path/to/git/based/project')
console.info(files) //-> ['index.js', 'foo.js', 'bar.js'...]

const filesWithoutFoo =
  findProjectFiles('/path/to/git/based/project', ['foo.js'])
console.info(filesWithoutFoo) //-> ['index.js', 'bar.js'...]

const filesWithoutFooBar =
  findProjectFiles('/path/to/git/based/project', ['foo.js', 'bar.js'])
console.info(filesWithoutFooBar) //-> ['index.js'...]
```

#### `checkIsProjectFilePath(rootPath: string, filePath: string, globalIgnorePatterns = [])`

```javascript
const { checkIsProjectFilePath } = require('find-project-files')

const isProjectFile = checkIsProjectFilePath(
  '/path/to/git/based/project',
  '/path/to/git/based/project/index.js'
)
console.info(isProjectFile) //-> true

const isIgnoredProjectFile = checkIsProjectFilePath(
  '/path/to/git/based/project',
  '/path/to/git/based/project/ignored.js'
)
console.info(isIgnoredProjectFile) //-> false

const isProjectFileExceptFoo = checkIsProjectFilePath(
  '/path/to/git/based/project',
  '/path/to/git/based/project/foo.js',
  ['foo.js']
)
console.info(isProjectFileExceptFoo) //-> false
```

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