#delete-file #directory #rm #delete #recursion #file

app rm-rs

A cross-platform alternative to rm

3 releases

0.2.2 Apr 7, 2024
0.2.1 Apr 7, 2024
0.2.0 Apr 7, 2024

#430 in Command line utilities

Download history 275/week @ 2024-04-07 9/week @ 2024-04-14

284 downloads per month

MIT license

25KB
213 lines

rm-rs

A cross-platform alternative to rm, written in Rust for native performance.

Installation

With npm

npm install --save-dev rm-rs
# OR
npx rm-rs

With pnpm

pnpm install --save-dev rm-rs
# OR
pnpm dlx rm-rs

With cargo

cargo install rm-rs

Usage examples

# Delete some files
rm-rs file1 file2 ...

# Delete an empty directory
rm-rs -d directory

# Delete a directory and all its children
rm-rs -r directory

# Delete a file, no errors if it doesn't exist
rm-rs -f file

Help

$ rm-rs --help

Usage: rm-rs [OPTIONS] <FILES>...

Arguments:
  <FILES>...

Options:
  -d          Attempt to remove directories as well as other types of files
  -r          Recursively remove directories and the files they contain. This implies the -d option
  -f          Ignore "file not found" errors
  -h, --help  Print help

Dependencies

~1.3–2MB
~36K SLoC