isaacs/rimraf — Issue #9: "sync" method fails when no directory found
Author: outaTiME
Created: 2011-11-23 14:55:19+00:00
State: open

Hi, Issacs ...

Yup .. like the title says ...

the sync method throw errors when no directory found ... but async method works fine ... take a look ...

usage:
```javascript
rimraf.sync('build'); // no directory exists
```

out:
```
Error: ENOENT, No such file or directory 'build'
at Object.lstatSync (fs.js:397:18)
at Function.rimrafSync [as sync] (/Users/outaTiME/Development/projects/node_modules/rimraf/rimraf.js:134:23)
at [object Object].action (/Users/outaTiME/Development/projects/skycop/skyweb-mvc/Jakefile:33:12)
at [object Object].runNextTask (/opt/node/lib/node_modules/jake/lib/jake.js:351:27)
at [object Object].runTask (/opt/node/lib/node_modules/jake/lib/jake.js:196:10)
at Object. (/opt/node/lib/node_modules/jake/bin/cli.js:73:10)
at Module._compile (module.js:432:26)
at Object..js (module.js:450:10)
at Module.load (module.js:351:31)
at Function._load (module.js:310:12)
```
otherwise ... the non sync method works fine ...

usage:
```javascript
rimraf('build', function() {
console.log('coool!');
});
```

my simple workaround was ... surround sync method with "exists" check ^^

thks !