# @rowanmanning/list-all-files

> List all files in a directory

Latest version **5.1.0** (published 2025-05-21) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @rowanmanning/list-all-files
pnpm add @rowanmanning/list-all-files
yarn add @rowanmanning/list-all-files
bun add @rowanmanning/list-all-files
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 5.1.0 |
| Published | 2025-05-21 |
| First published | 2020-03-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | 20.x \|\| 22.x \|\| 24.x |
| Dependencies | 0 |
| Unpacked size | 5.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Rowan Manning |
| Maintainers | rowanmanning |
| Keywords | fs, list, readdir |

## Links

- npm: https://www.npmjs.com/package/@rowanmanning/list-all-files
- Repository: https://github.com/rowanmanning/list-all-files
- Issues: https://github.com/rowanmanning/list-all-files/issues
- npm.io page: https://npm.io/package/@rowanmanning/list-all-files

## 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

- 5.1.0 (latest) — 2025-05-21
- 5.0.0 — 2025-03-08
- 4.2.1 — 2024-07-27
- 4.2.0 — 2024-06-23
- 4.1.0 — 2024-01-30
- 4.0.0 — 2023-09-11
- 3.0.3 — 2023-07-25
- 3.0.2 — 2023-07-20
- 3.0.1 — 2023-04-18
- 3.0.0 — 2023-03-25
- 2.2.4 — 2023-02-14
- 2.2.3 — 2023-01-08
- 2.2.2 — 2022-11-14
- 2.2.1 — 2022-07-09
- 2.2.0 — 2022-06-10
- … 9 more at https://npm.io/package/@rowanmanning/list-all-files/versions

## README

# @rowanmanning/list-all-files

List all files in a directory recursively.

> [!WARNING]
> This library will be deprecated in April 2026 to coincide with the end-of-life date for Node.js 20. This is because the native [`fs.glob`](https://nodejs.org/api/fs.html#fspromisesglobpattern-options) and [`fs.globSync`](https://nodejs.org/api/fs.html#fsglobsyncpattern-options) methods in Node.js 22 and above provide the same functionality.

* [Requirements](#requirements)
* [Usage](#usage)
  * [Asynchronous Interface](#asynchronous-interface)
  * [Synchronous Interface](#synchronous-interface)
* [Migration](#migration)
* [Contributing](#contributing)
* [License](#license)


## Requirements

This library requires the following to run:

  * [Node.js](https://nodejs.org/) 20+


## Usage

Install with [npm](https://www.npmjs.com/):

```sh
npm install @rowanmanning/list-all-files
```

### Asynchronous Interface

Load the library into your code with `require`:

```js
const { listAllFiles } = require('@rowanmanning/list-all-files');
```

List all files in a directory asynchronously, using promises or `async`/`await`:

```js
listAllFiles('./directory-path').then(files => {
    // files is an array of strings, each being the path to a file
});
```

or

```js
const files = await listAllFiles('./directory-path');
// files is an array of strings, each being the path to a file
```

### Synchronous Interface

Load the library into your code with `require`:

```js
const { listAllFilesSync } = require('@rowanmanning/list-all-files');
```

List all files in a directory synchronously:

```js
const files = listAllFilesSync('./directory-path');
// files is an array of strings, each being the path to a file
```


## Migration

A new major version of this project is released if breaking changes are introduced. We maintain a [migration guide](docs/migration.md) to help users migrate between these versions.


## Contributing

[The contributing guide is available here](docs/contributing.md). All contributors must follow [this library's code of conduct](docs/code_of_conduct.md).


## License

Licensed under the [MIT](LICENSE) license.<br/>
Copyright &copy; 2020, Rowan Manning

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