rm-rf-async
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

rm-rf-async

NPM

Env

node version: >= 8.0.0, because use util.promisify;

Install

$ npm install rm-rf-async

Usage

you can use async/await

const rmrf = require('rm-rf-async');
const path = require('path');
 
(async () => {
    await rmrf(path.join(__dirname, './**/space'));
    console.log('delete over');
})();

or use promise

const rmrf = require('rm-rf-async');
const path = require('path');
 
rmrf(path.join(__dirname, './**/space')).then(_ => console.log('delete over'));

or you can use callback

const rmrf = require('rm-rf-async');
const path = require('path');
 
rmrf(path.join(__dirname, './**/c.js'), () => {
    console.log('delete over')
})

By default, there is a log, you can remove the log by use {log: false} in secend argument, for Example:

(async () => {
    await rmrf(path.join(__dirname, './**/space'), {log: false});
    console.log('delete over');
})();

Readme

Keywords

Package Sidebar

Install

npm i rm-rf-async

Weekly Downloads

1

Version

1.2.0

License

ISC

Unpacked Size

122 kB

Total Files

15

Last publish

Collaborators

  • soyzr