Name | Version | Size | License | Type | Vulnerabilities |
---|---|---|---|---|---|
balanced-match | 1.0.2 | 2.61 kB | MIT | prod | |
brace-expansion | 1.1.11 | 4.14 kB | MIT | prod | |
concat-map | 0.0.1 | 2.21 kB | MIT | prod | |
fs.realpath | 1.0.0 | 4.33 kB | ISC | prod | |
glob | 7.2.3 | 15.08 kB | ISC | prod | |
inflight | 1.0.6 | 1.99 kB | ISC | prod | |
inherits | 2.0.4 | 1.98 kB | ISC | prod | |
minimatch | 3.1.2 | 11.66 kB | ISC | prod | |
once | 1.4.0 | 1.93 kB | ISC | prod | |
path-is-absolute | 1.0.1 | 1.84 kB | MIT | prod | |
rimraf | 2.5.4 | 5 kB | ISC | prod | |
wrappy | 1.0.2 | 1.64 kB | ISC | prod |
Rimraf is a deep deletion module for node, similar to the UNIX command 'rm -rf'. It's designed to effectively and efficiently remove files and directories, overcoming challenges presented by different operating systems like Windows and UNIX-based platforms. Offering flexibility, the rimraf module can execute operations via a native implementation (default) or Windows implementation.
To use rimraf, you first need to install it with npm using the command npm install rimraf
. Following this, you can import the required functions from the rimraf package using either import
or require()
.
Here are some examples of how to use rimraf:
// Using import
import { rimraf, rimrafSync, native, nativeSync } from 'rimraf'
// Using require()
const { rimraf, rimrafSync, native, nativeSync } = require('rimraf')
rimraf('/path/to/delete', options).then(success => console.log(success));
const success = rimrafSync('/path/to/delete', options);
console.log(success);
Options can be passed to define the behavior of the rimraf function, such as preserveRoot
, tmp
, maxRetries
, backoff
, and maxBackoff
.
The documentation for rimraf can be found in its GitHub repository, at git://github.com/isaacs/rimraf.git
. The readme file included in the repository provides a detailed explanation of the module's functionality, its API, configuration options, and various implementations. It also includes the major changes in the different versions of the module. The repository is the go-to source for developers seeking to understand and use rimraf effectively.