# @pnpm/modules-cleaner

> Exports util functions to clean up node_modules

Latest version **1001.0.35** (published 2026-03-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install @pnpm/modules-cleaner
pnpm add @pnpm/modules-cleaner
yarn add @pnpm/modules-cleaner
bun add @pnpm/modules-cleaner
```

## Health

**Score 75/100 (B)** — status: stable.

Positive: has types; esm support; no vulnerabilities; has provenance; high maintenance score; high quality score; popular repo.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1001.0.35 |
| Published | 2026-03-24 |
| First published | 2018-10-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=18.12 |
| Dependencies | 11 |
| Unpacked size | 26.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 36783 |
| Maintainers | pnpmuser, zkochan |
| Keywords | pnpm, pnpm10 |

## Links

- npm: https://www.npmjs.com/package/@pnpm/modules-cleaner
- Repository: https://github.com/pnpm/pnpm.git#main
- Homepage: https://github.com/pnpm/pnpm/tree/main/pkg-manager/modules-cleaner#readme
- Issues: https://github.com/pnpm/pnpm/issues
- Funding: https://opencollective.com/pnpm
- npm.io page: https://npm.io/package/@pnpm/modules-cleaner

## Dependencies (11)

- [ramda](https://npm.io/package/ramda.md) npm:@pnpm/ramda@0.28.1
- [@pnpm/types](https://npm.io/package/@pnpm/types.md) 1001.3.0
- [@zkochan/rimraf](https://npm.io/package/@zkochan/rimraf.md) ^3.0.2
- [@pnpm/remove-bins](https://npm.io/package/@pnpm/remove-bins.md) 1000.0.22
- [@pnpm/core-loggers](https://npm.io/package/@pnpm/core-loggers.md) 1001.0.9
- [@pnpm/lockfile.types](https://npm.io/package/@pnpm/lockfile.types.md) 1002.1.0
- [@pnpm/lockfile.utils](https://npm.io/package/@pnpm/lockfile.utils.md) 1004.0.3
- [@pnpm/dependency-path](https://npm.io/package/@pnpm/dependency-path.md) 1001.1.10
- [@pnpm/read-modules-dir](https://npm.io/package/@pnpm/read-modules-dir.md) 1000.0.0
- [@pnpm/lockfile.filtering](https://npm.io/package/@pnpm/lockfile.filtering.md) 1001.0.31
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) 1004.5.1

## Recent versions

- 1001.0.35 (latest) — 2026-03-24
- 1001.0.39 (latest-10) — 2026-09-28
- 900.0.3 (latest-9) — 2025-01-13
- 0.0.0-20230605-20230605142810 (dev) — 2023-06-05
- 11.0.29 (latest-6) — 2022-07-05
- 10.0.7 (pnpm-temp) — 2020-08-16
- 8.0.15 (next) — 2020-04-09
- 3.0.0-1 (next-major) — 2019-03-04
- 1001.0.38 — 2026-06-10
- 1001.0.37 — 2026-05-27
- 1001.0.36 — 2026-05-06
- 1001.0.34 — 2026-02-17
- 1001.0.33 — 2026-01-26
- 1001.0.32 — 2026-01-19
- 1001.0.31 — 2025-12-30
- … 250 more at https://npm.io/package/@pnpm/modules-cleaner/versions

## README

# @pnpm/modules-cleaner

> Exports util functions to clean up node_modules

## Install

```
pnpm install @pnpm/modules-cleaner
```

## API

### `prune(...args)`

Compares the wanted lockfile with the current one and removes redundant packages from `node_modules`.

### `removeDirectDependency(...args)`

Removes a direct dependency from `node_modules`.

## License

MIT

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