https://github.com/stijnvanhulle/rustraf
The UNIX command rm -rf for node written with Rust.
https://github.com/stijnvanhulle/rustraf
linux node remove rust
Last synced: 5 months ago
JSON representation
The UNIX command rm -rf for node written with Rust.
- Host: GitHub
- URL: https://github.com/stijnvanhulle/rustraf
- Owner: stijnvanhulle
- License: mit
- Created: 2022-06-12T21:01:10.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-09-01T12:30:40.000Z (over 1 year ago)
- Last Synced: 2025-09-29T19:28:51.459Z (5 months ago)
- Topics: linux, node, remove, rust
- Language: JavaScript
- Homepage:
- Size: 435 KB
- Stars: 13
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# @rustraf/core
The [UNIX command]() `rm -rf` for node written with Rust.
## API
```
import { remove, removeFile, removeDir } from "@rustraf/core";
```
`remove(fileOrFolder)`
Remove a folder or a file, the same behaviour as 'rm -rf fileOrFolder'
It will remove empty directories that lack read access on Linux, and will remove "read-only" files and directories on Windows.
`removeFile(file)`
Remove a file.
`removeDir(dir)`
Remove a folder and all it's underlying content.
## CLI
If installed with
```
npm install @rustraf/core -g
```
```
yarn global add @rustraf/core
```
it can be used as a global
command `rustraf [ ...]` which is useful for cross platform support.
## Compared with rimraf
Removing node_modules with a size of 597,5 MB
| Package | Speed |
|---------|-----------------------------------------------|
| [rimraf](https://www.npmjs.com/package/rimraf) | 1.61s user 11.26s system 218% cpu 5.899 total |
| [@rustraf/core](https://www.npmjs.com/package/@rustraf/core) | 0.28s user 5.79s system 84% cpu 7.218 total |
| native(darwin-arm64) | 0.06s user 5.38s system 86% cpu 6.293 total |
## Supporting rustraf
Rimraf uses an MIT-licensed open source project with its ongoing development made possible entirely by the support of Sponsors. If you would like to become a sponsor, please consider:
- [Become a Sponsor on GitHub](https://github.com/sponsors/stijnvanhulle)