crossrm
v1.0.0
Published
The [UNIX command](http://en.wikipedia.org/wiki/Rm_(Unix)) `rm -rf` for Node.js in a cross-platform implementation. Significantly smaller than `rimraf`!
Downloads
25
Maintainers
Readme
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 });