rimraf

Cross-platform recursive file and directory removal for Node.js, modeled on the UNIX `rm -rf` command.

Library
npm
v6.1.3
5,848stars
BlueOak-1.0.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
43/100Fair
Development Activity16
Maintenance0
Community56
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
76/100Good
Architecture78
Code Quality82
Innovation70
Learning Curve75

rimraf is a small, battle-tested Node.js module that recursively deletes files and directories, providing a reliable cross-platform equivalent to the UNIX rm -rf command. It ships both a programmatic API (rimraf, rimrafSync, and platform-specific strategies like native, windows, and moveRemove) and a CLI binary, and automatically selects the fastest safe implementation for the current Node.js version and operating system.

Because deleting files reliably across Windows, macOS, and Linux involves subtle edge cases (locked files, EBUSY/EPERM errors, non-atomic unlink/rmdir calls), rimraf has become a de-facto standard dependency in build tools, test harnesses, and CLI utilities that need to clean up directories without reinventing platform-specific retry and fallback logic.

What You Get

  • Async and sync APIs (rimraf, rimrafSync) that resolve to a boolean success value
  • Multiple removal strategies (native, windows, manual, posix, moveRemove) selectable per platform or forced explicitly
  • A CLI binary supporting glob patterns, verbose output, interactive confirmation, and configurable retry/backoff
  • An AbortSignal-aware API for cancelling long-running directory removals
  • A filter option to selectively exclude paths from deletion while still recursing into their children

Common Use Cases

  • Cleaning build output directories (dist/, build/) before a fresh compile
  • Removing temporary test fixtures and scratch directories between test runs
  • Deleting node_modules or cache directories as part of a reset/clean npm script
  • Deleting arbitrary glob-matched paths from a CLI or CI pipeline step

Under The Hood

Architecture rimraf is organized around a shared wrap/wrapSync higher-order function (src/index.ts) that normalizes single-path and array-of-paths inputs, resolves glob patterns via the glob package, and dispatches to one of five interchangeable removal strategies (native, posix, windows, manual, moveRemove), each implemented in its own module (rimraf-native.ts, rimraf-posix.ts, rimraf-windows.ts, rimraf-manual.ts, rimraf-move-remove.ts). use-native.ts decides at call time whether the built-in fs.rm can be used, falling back to the JS-implemented Windows/POSIX strategies when a filter or signal option is supplied, since Node’s native implementation doesn’t support those.

Tech Stack The project is TypeScript-first, built with tshy to emit dual ESM/CommonJS output, targets Node 20 or >=22, and depends on only two runtime packages (glob and package-json-from-dist). Testing uses tap with recorded snapshots in tap-snapshots/, linting uses oxlint, and docs are generated via typedoc.

Code Quality The test/ directory mirrors src/ one-to-one (17 files) plus an integration/ suite, with dedicated coverage for edge cases like EPERM handling (fix-eperm.ts) and ENOENT-safe readdir (ignore-enoent.ts). Modules are small and single-purpose, options parsing/validation is centralized in opt-arg.ts rather than duplicated per-strategy, and the codebase carries no any-typed escape hatches in the reviewed entry points.

API Design The public surface is intentionally narrow: rimraf/rimrafSync cover the common case, with named exports (native, windows, manual, posix, moveRemove) available for callers who need to force a specific strategy. All removal functions return a plain boolean rather than throwing on partial removal, and the CLI mirrors the same option set (--glob, --impl, --preserve-root), keeping the library and CLI mental models consistent.

Used by 85 apps in this directory

TypeScript
72%
AGPL 3.0

APITable

Low Code Platforms · Databases

15,526

API-first collaborative spreadsheet-database platform that auto-generates REST APIs and lets teams build internal tools, CRMs, and dashboards without code.

View details
53
Repo Health
77
Technical
60
Dependency
Built with
TypeScript72%
Java22%
Updated 9 months ago
TypeScript
63%
MIT

ALTCHA

Security

2,679

A self-hosted, privacy-first CAPTCHA alternative that uses memory-hard proof-of-work to stop bots without cookies, tracking, or third-party APIs.

View details
75
Repo Health
79
Technical
75
Dependency
Built with
TypeScript63%
Svelte29%
Updated today
TypeScript
84%
MIT

Amical

Note Taking · AI Assistants

1,495

Local-first AI dictation that understands your active app — private, offline, and built for speed.

View details
79
Repo Health
82
Technical
67
Dependency
Built with
TypeScript84%
Updated 3 weeks ago
TypeScript
96%
Other

Amplication

Developer Tools · AI Code Assistants · Automation

16,010

Create production-ready backend services with your organization's standards baked in — generating NestJS, Prisma, and GraphQL code that you own and control.

View details
61
Repo Health
84
Technical
60
Dependency
Built with
TypeScript96%
Updated 1 months ago
JavaScript
94%
MIT

Another Redis Desktop Manager

Developer Tools · Databases

34,643

Fast, stable Redis GUI with cluster, SSH, and massive key support

View details
84
Repo Health
56
Technical
67
Dependency
Built with
JavaScript94%
Updated yesterday
TypeScript
69%
Other

Budibase

Low Code Platforms · No Code Platforms

28,220

Build AI agents, automations, and internal apps on a single open-source platform with full self-hosting control.

View details
92
Repo Health
81
Technical
63
Dependency
Built with
TypeScript69%
Svelte26%
Updated today
Python
83%
Other

Bugsink

Developer Tools · Monitoring

2,018

Self-hosted error tracking that accepts Sentry SDKs out of the box, so you keep your instrumentation and drop the monthly bill.

View details
84
Repo Health
80
Technical
76
Dependency
Built with
Python83%
HTML15%
Updated 1 weeks ago
TypeScript
72%
MIT

Claude Context

AI Code Assistants

12,417

An MCP server and VS Code extension by Zilliz that turns your entire codebase into semantically searchable context for Claude Code, Cursor, and Gemini CLI, using vector embeddings and Merkle-tree change detection.

View details
55
Repo Health
71
Technical
72
Dependency
Built with
TypeScript72%
Python13%
JavaScript11%
Updated 1 months ago
TypeScript
97%
Apache 2.0

Cline

AI Code Assistants

66,453

An open-source AI coding agent that lives in your editor and terminal — reads and edits your codebase, runs commands, browses the web, and requires human approval for every action by default.

View details
90
Repo Health
74
Technical
67
Dependency
Built with
TypeScript97%
Updated today

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search