Skip to content

Latest commit

 

History

History
33 lines (30 loc) · 837 Bytes

README.md

File metadata and controls

33 lines (30 loc) · 837 Bytes

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.