Code Monkey home page Code Monkey logo

rmfr's Introduction

rmfr

npm version Build Status Build status Coverage Status

Node.js implementation of rm -fr – recursive removal of files and directories

const rmfr = require('rmfr');

(async () => await rmfr('path/to/target'))();

Installation

Use npm.

npm install rmfr

API

const rmfr = require('rmfr');

rmfr(path [, options])

path: string (a file/directory path)
options: Object
Return: Promise

When it finish removing a target, it will be fulfilled with no arguments.

When it fails to remove a target, it will be rejected with an error as its first argument.

Options

All rimraf options except for disableGlob are available, with some differences:

  • glob option defaults to false.
  • unlink, chmod, rmdir and readdir options default to the corresponding graceful-fs methods.
const rmfr = require('rmfr');

rmfr('inde*.js'); // doesn't remove `./index.js`
rmfr('inde*.js', {glob: true}); // removes `./index.js`

License

ISC License © 2017 - 2018 Shinnosuke Watanabe

rmfr's People

Contributors

shinnn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

rmfr's Issues

No changelog

Hello,

Could you please add a changelog? It is difficult to see what has changed between 1.x and 2.x.

Thanks!

function completes before deleting anything

const rmfr = require('rmfr');

(async () => {
  console.log('start');
  await rmfr('my/path/here');
  console.log('end');
})();

When running this code, both 'start' and 'end' go off at the same time before anything in deleted. Am I misunderstanding how this is supposed to work?

I would like to wait until the folder is completely deleted before the promise is fulfilled.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.