Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 37 lines (25 sloc) 1.3 kb
b6cff0c Tom Byrer + UNIX command link
tomByrer authored
1 The [UNIX command](http://en.wikipedia.org/wiki/Rm_(Unix)) `rm -rf` for node.
cabcc5b isaacs install instructions
authored
2
3 Install with `npm install rimraf`, or just drop rimraf.js somewhere.
15ddf51 isaacs Document options
authored
4
5 ## API
6
259f75b isaacs Remove options, check dirs for writableness, too
authored
7 `rimraf(f, callback)`
15ddf51 isaacs Document options
authored
8
9 The callback will be called with an error if there is one. Certain
10 errors are handled for you:
11
cfabe1d isaacs Correct readme error handling doc
authored
12 * Windows: `EBUSY` and `ENOTEMPTY` - rimraf will back off a maximum of
18c50e7 isaacs Make maxBusyTries and emfileWait configurable
authored
13 `opts.maxBusyTries` times before giving up, adding 100ms of wait
14 between each attempt. The default `maxBusyTries` is 3.
cfabe1d isaacs Correct readme error handling doc
authored
15 * `ENOENT` - If the file doesn't exist, rimraf will return
16 successfully, since your desired outcome is already the case.
18c50e7 isaacs Make maxBusyTries and emfileWait configurable
authored
17 * `EMFILE` - Since `readdir` requires opening a file descriptor, it's
18 possible to hit `EMFILE` if too many file descriptors are in use.
19 In the sync case, there's nothing to be done for this. But in the
20 async case, rimraf will gradually back off with timeouts up to
21 `opts.emfileWait` ms, which defaults to 1000.
15ddf51 isaacs Document options
authored
22
23 ## rimraf.sync
24
25 It can remove stuff synchronously, too. But that's not so good. Use
26 the async API. It's better.
cc5580b Forbes Lindesay Add `rimraf` binary
ForbesLindesay authored
27
28 ## CLI
29
30 If installed with `npm install rimraf -g` it can be used as a global
3d533f6 isaacs bin: Support multiple args
authored
31 command `rimraf <path>` which is useful for cross platform support.
33970b5 Forbes Lindesay Add link to mkdirp
ForbesLindesay authored
32
33 ## mkdirp
34
35 If you need to create a directory recursively, check out
36 [mkdirp](https://github.com/substack/node-mkdirp).
Something went wrong with that request. Please try again.