Coder Social home page Coder Social logo

node-remy's Introduction

Remy License NPM version Build Status Coverage Status

Remove files with emitter (also in zip packages).

Global

remy can be installed globally with

npm i remy -g

And used this way:

Usage: remy [path]
Options:
  -h, --help      display this help and exit
  -v, --version   output version information and exit

Local

Remy can be used localy. It will emit event on every copied file. Good for making progress bars.

Install

npm i remy --save

How to use?

remy(from[, names])

  • from - path to directory with files or directories to remove
  • names - array of file names (optional)
const remy = require('remy');
const cwd = process.cwd();
const abortOnError = false;

const rm = remy(cwd, ['LICENSE', 'README.md', 'package.json']);

rm.on('file', (name) => {
    console.log(name);
});

rm.on('directory', (name) => {
    console.log(name);
});

rm.on('progress', (percent) => {
    console.log(percent);
    
    if (percent >= 50) {
        rm.pause();
        rm.continue();
    }
});

rm.on('error', (error) => {
    rm.continue();
});

rm.on('end', () => {
    console.log('Removing ended up');
});

In case of starting example output should be similar to:

33%
67%
100%
Removing ended up

Related

  • Copymitter - Copy files with emitter.
  • Jaguar - Pack and extract .tar.gz archives with emitter.
  • OneZip - Pack and extract zip archives with emitter.
  • Tar-to-zip - Convert tar and tar.gz archives to zip.

License

MIT

node-remy's People

Contributors

coderaiser avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

scottpeterman

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.