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.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.2.2
    36
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.2.2
    36
  • 0.2.1
    2
  • 0.2.0
    0
  • 0.1.0
    3

Package Sidebar

Install

npm i rm-dir

Weekly Downloads

2

Version

0.2.2

License

MIT

Last publish

Collaborators

  • realtimecom