# file-set

> Cross-platform glob expansions simplified. Input: file paths and glob expressions. Output: resolved file paths organised by type (file, directory and not-found).

Latest version **5.3.0** (published 2025-07-17) · MIT license · 0 weekly downloads

## Install

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

## Health

**Score 30/100 (F)** — status: maintenance-mode.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 5.3.0 |
| Published | 2025-07-17 |
| First published | 2014-06-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | >=12.17 |
| Dependencies | 2 |
| Unpacked size | 8.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Lloyd Brookes |
| Maintainers | 75lb |
| Keywords | glob, files, node-glob, fast-glob, globstar |

## Links

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

## Dependencies (2)

- [fast-glob](https://npm.io/package/fast-glob.md) ^3.3.2
- [array-back](https://npm.io/package/array-back.md) ^6.2.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

- 5.3.0 (latest) — 2025-07-17
- 1.1.2 (prev) — 2018-09-24
- 5.2.2 — 2024-08-31
- 5.2.1 — 2024-08-31
- 5.2.0 — 2024-08-30
- 6.0.1 — 2024-08-26
- 6.0.0 — 2024-08-25
- 5.1.3 — 2022-01-14
- 5.1.2 — 2021-08-13
- 5.1.1 — 2021-07-24
- 5.1.0 — 2021-07-24
- 5.0.1 — 2021-06-29
- 5.0.0 — 2021-06-06
- 4.0.2 — 2021-03-13
- 4.0.1 — 2020-05-25
- … 22 more at https://npm.io/package/file-set/versions

## README

[![view on npm](https://badgen.net/npm/v/file-set)](https://www.npmjs.org/package/file-set)
[![npm module downloads](https://badgen.net/npm/dt/file-set)](https://www.npmjs.org/package/file-set)
[![Gihub repo dependents](https://badgen.net/github/dependents-repo/75lb/file-set)](https://github.com/75lb/file-set/network/dependents?dependent_type=REPOSITORY)
[![Gihub package dependents](https://badgen.net/github/dependents-pkg/75lb/file-set)](https://github.com/75lb/file-set/network/dependents?dependent_type=PACKAGE)
[![Node.js CI](https://github.com/75lb/file-set/actions/workflows/node.js.yml/badge.svg)](https://github.com/75lb/file-set/actions/workflows/node.js.yml)

# file-set

Cross-platform glob expansions simplified. Input: file paths and glob expressions. Output: resolved file paths organised by type (file, directory and not-found). It handles all the cross-platform issues associated with file paths.


Particularly useful for handling user input, for example a CLI utility which accepts a list of file paths and globs.

```
$ example-utility index.js * not/existing/*
```

The example-utility above could pass its user input into `FileSet`. Call `await .add(<string[]>)` as many times as necessary, adding more path/glob expressions each time.

```js
import FileSet from 'file-set'
const fileSet = new FileSet()
await fileSet.add([ 'index.js', '*', 'not/existing/*' ])
console.log(fileSet)
```

The output has been organised into sets. Any duplicates caused by overlapping glob expressions are removed.

```
FileSet {
  files: [ 'index.js', 'LICENSE', 'package.json', 'README.md' ],
  dirs: [ 'jsdoc2md/', 'lib/', 'node_modules/', 'test/' ],
  notExisting: [ 'not/existing/*' ]
}
```

* * *

&copy; 2014-25 [Lloyd Brookes](https://github.com/75lb) \<opensource@75lb.com\>.

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