# @yarnpkg/fslib

Latest version **3.1.5** (published 2026-03-19) · BSD-2-Clause license · 0 weekly downloads

## Install

```sh
npm install @yarnpkg/fslib
pnpm add @yarnpkg/fslib
yarn add @yarnpkg/fslib
bun add @yarnpkg/fslib
```

## Health

**Score 60/100 (C)** — status: stable.

Positive: esm support; no vulnerabilities; has provenance; high maintenance score.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 3.1.5 |
| Published | 2026-03-19 |
| First published | 2019-09-05 |
| Weekly downloads | 0 |
| License | BSD-2-Clause |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=18.12.0 |
| Dependencies | 1 |
| Unpacked size | 227.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 8106 |
| Maintainers | arcanis, yarnbot |

## Links

- npm: https://www.npmjs.com/package/@yarnpkg/fslib
- Repository: https://github.com/yarnpkg/berry
- npm.io page: https://npm.io/package/@yarnpkg/fslib

## Dependencies (1)

- [tslib](https://npm.io/package/tslib.md) ^2.4.0

## Recent versions

- 3.1.5 (latest) — 2026-03-19
- 2.10.4 (v3) — 2024-02-01
- 3.1.4 — 2025-11-07
- 3.1.3 — 2025-09-18
- 3.1.2 — 2025-03-01
- 3.1.1 — 2024-11-22
- 3.1.0 — 2024-05-08
- 3.0.2 — 2024-01-30
- 3.0.1 — 2023-10-28
- 3.0.0 — 2023-10-22
- 3.0.0-rc.53 — 2023-10-03
- 3.0.0-rc.52 — 2023-09-29
- 3.0.0-rc.51 — 2023-09-17
- 3.0.0-rc.50 — 2023-08-23
- 3.0.0-rc.49 — 2023-08-17
- … 121 more at https://npm.io/package/@yarnpkg/fslib/versions

## README

# `@yarnpkg/fslib`

A TypeScript library abstracting the Node filesystem APIs. We use it for three main reasons:

## Type-safe paths

Our library has two path types, `NativePath` and `PortablePath`. Most interfaces only accept the later, and instances of the former need to be transformed back and forth using our type-safe utilities before being usable.

## Custom filesystems

The FSLib implements various transparent filesystem layers for a variety of purposes. For instance we use it in Yarn in order to abstract away the zip archive manipulation logic, which is implemented in `ZipFS` and exposed through a Node-like interface (called `FakeFS`).

All `FakeFS` implementations can be transparently layered on top of the builtin Node `fs` module, and that's for instance how we can add support for in-zip package loading without you having to care about the exact package format.

## Promisified API

All methods from the `FakeFS` interface are promisified by default (and suffixed for greater clarity, for instance we offer both `readFileSync` and `readFilePromise`).

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