0.2.2 • Published 6 years ago

rm-dir v0.2.2

Weekly downloads
173
License
MIT
Repository
github
Last release
6 years ago

rm-dir

Remove directory and all its contents, sync, async callback or promise

rm-dir is a very fast and simple function, based on native File System (FS) functions, no additional module is required.

$ npm install rm-dir

Include in your script

const rmdir = require('rm-dir');

SYNC, no callback function, use "try & catch" for errors

rmdir('/path/dir');

ASYNC, with callback function "console.log"

rmdir('/path/dir', console.log);

Promise

rmdir.promise('/path/dir').then(console.log).catch(console.error);

async / await

(async () => {
    console.log(await rmdir.promise('/path/dir'));
})().catch(console.error);

rm-dir is licensed under the MIT license. See the included LICENSE file for more details.