vlad 6f123ff03e 18.07 | před 6 roky | |
---|---|---|
.. | ||
test | před 6 roky | |
AUTHORS | před 6 roky | |
LICENSE | před 6 roky | |
README.md | před 6 roky | |
bin.js | před 6 roky | |
package.json | před 6 roky | |
rimraf.js | před 6 roky |
rm -rf
for node.
Install with npm install rimraf
, or just drop rimraf.js somewhere.
rimraf(f, callback)
The callback will be called with an error if there is one. Certain errors are handled for you:
EBUSY
and ENOTEMPTY
- rimraf will back off a maximum of
opts.maxBusyTries
times before giving up.ENOENT
- If the file doesn't exist, rimraf will return
successfully, since your desired outcome is already the case.It can remove stuff synchronously, too. But that's not so good. Use the async API. It's better.
If installed with npm install rimraf -g
it can be used as a global
command rimraf <path>
which is useful for cross platform support.
If you need to create a directory recursively, check out mkdirp.