Wipe out a build output folder like `dist/` or `node_modules/` as part of an npm script
Clean up temporary directories created during automated tests so the next run starts fresh
Delete a folder tree cross-platform in a Node.js script without worrying about Windows file-locking errors
Cancel a long folder deletion halfway through using an AbortSignal in an async workflow
| isaacs/rimraf | vanilagy/mediabunny | angular/flex-layout | |
|---|---|---|---|
| Stars | 5,841 | 5,842 | 5,845 |
| Language | TypeScript | TypeScript | TypeScript |
| Setup difficulty | easy | easy | easy |
| Complexity | 1/5 | 2/5 | 2/5 |
| Audience | developer | developer | developer |
Figures from each repo's GitHub metadata at analysis time.
Requires Node.js 20 or 22+, install via npm install rimraf.
Rimraf is a Node.js utility for deleting files and entire folder trees in one operation. It is the cross-platform equivalent of the Unix command rm -rf, which removes everything inside a directory recursively without asking for confirmation. The name comes from that command. It is installed via npm and used in JavaScript projects wherever you need to wipe out a directory as part of a build, cleanup, or deployment script. The library exists because Node.js itself did not always provide a built-in way to delete folders reliably across operating systems. Windows in particular causes problems when deleting files that are still open or locked by another process. Rimraf handles those cases with automatic retries and a fallback strategy that moves files to a temporary location before removing them, which works around Windows file locking issues. The API is straightforward: call rimraf with a path (or a list of paths) and it returns a Promise that resolves when deletion is complete. A synchronous version is also available. Options let you delete only files matching a pattern, skip certain files with a filter function, or cancel the operation partway through using an AbortSignal. The README includes a prominent safety warning: you must never pass input from untrusted users to this function. Because its purpose is permanent deletion, passing the wrong path can destroy important data. The responsibility for what paths are passed to it stays with the developer using it. Version 4 and later default to the built-in Node.js removal API on modern Node versions, falling back to the older JavaScript implementations only when needed. The current version requires Node 20 or 22 and above.
A Node.js utility that deletes entire folders in one call, cross-platform, the JavaScript equivalent of `rm -rf`, with built-in retries to handle Windows file-locking issues.
Mainly TypeScript. The stack also includes TypeScript, Node.js, npm.
No license information was mentioned in the explanation.
Setup difficulty is rated easy, with roughly 5min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.