# file-collector

> A simple program to get and filter lists of files in a directory. Useful when you need a large array of files and want to get it programmatically.

Latest version **1.0.0** (published 2021-02-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install file-collector
pnpm add file-collector
yarn add file-collector
bun add file-collector
```

Provides the command `file-collector`.

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2021-02-25 |
| First published | 2021-02-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Michael A. Cook |
| Maintainers | michaelacook |
| Keywords | readdir, array, files |

## Links

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

## 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.0 (latest) — 2021-02-25

## README

# File Collector

A simple program to programmatically output an array of files. This is useful when you need a list of files but manually compiling a list would be too labour intensive. Basically `fs.readdir()` with options.

## Installation

`npm install -g file-collector`

## Usage

`file-collector [path=[path]] [exclude=[exclude]] [filter=[filter]] [extension=[extension]]`

Running `file-collector` with no arguments will output a `.js` file in the current working directory that exports an array of all files in the current working directory. Currently the program ignores folders and only outputs files. To specify a different directory to scan, use the argument `path=[path]`.

To exclude files that contain a term use the argument `exclude=[term]`.

To return only files that contain a term, use the argument `filter=[term]`.

To return only files of a certain file extension use the argument `extension=.[extension]`.

E.g:

`file-collector exclude=personal extension=.html`

The order that options are specified does not matter.

## License

MIT

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