Skip to content

Remove directory and all its contents, sync or async

License

Notifications You must be signed in to change notification settings

RealTimeCom/rm-dir

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Remove directory and all its contents, sync or async

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published