Is node.js rmdir recursive ? Will it work on non empty directories?

Although using a third-party library for such a thing I could not come up with a more elegant solution. So I ended up using the npm-module rimraf.

Install it

npm install rimraf

Or install it and save to ‘package.json’
(other save options can be found in the npm-install docs)

npm install --save rimraf

Then you can do the following:

rmdir = require('rimraf');
rmdir('some/directory/with/files', function(error){});

Or in Coffeescript:

rmdir = require 'rimraf'
rmdir 'some/directory/with/files', (error)->

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)