rm-dir

0.2.2 • Public • Published

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.

Package Sidebar

Install

npm i rm-dir

Weekly Downloads

0

Version

0.2.2

License

MIT

Last publish

Collaborators

  • realtimecom