Skip to content

`rm -rf` in a cross-platform implementation. Significantly smaller than rimraf!

License

Notifications You must be signed in to change notification settings

NotWoods/crossrm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

crossrm

The UNIX command rm -rf for Node.js in a cross-platform implementation. Significantly smaller than rimraf!

Usage

npx crossrm ./path

Why no JavaScript API?

Node.js v14.14 and up supports the built-in fs.rm function, which does everything you need. This package is just a thin CLI wrapper around the function.

import { rm } from 'node:fs/promises';
import { rmSync } from 'node:fs';

// This will throw an error if the path does not exist.
await rm(path, { recursive: true });
rmSync(path, { recursive: true });

// This will do nothing if the path does not exist.
await rm(path, { recursive: true, force: true });
rmSync(path, { recursive: true, force: true });

About

`rm -rf` in a cross-platform implementation. Significantly smaller than rimraf!

Topics

Resources

License

Stars

Watchers

Forks