Giter Club home page Giter Club logo

flop's Introduction

Flop License NPM version Build Status

FLOP - Folder operations module.

Install

For use as application you could use global install.

npm i flop -g

If you run flop -h you will see:

flop - folder operations module.
options:
-h, --help - show this message
-r, --read - get directory content

Also you can use flop as a module if install with

npm i flop

API

create

Create new directory.

const flop = require('flop');

flop.create('./hello/world/from/flop', (error, data) => {
    console.log(error, data);
});

read

Read content of directory with permisions and sizes.

Parameters:

  • path
  • type (optional)
  • options (optional)

Posible type:

  • raw
  • size
  • size raw
const flop = require('flop');

await flop.read('.');
await flop.read('.', {
    sort: 'size',
});
await flop.read('.', 'raw');
await flop.read('.', 'size');
await flop.read('.', 'size raw');

copy

const flop = require('flop');

await flop.copy('from', 'to');

move

const flop = require('flop');

await flop.move('from', 'to');

remove

await flop.remove('path/to/remove');
await flop.remove('path/to/remove', ['folder1', 'folder2']);

License

MIT

flop's People

Contributors

coderaiser avatar tyzbit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

scottpeterman

flop's Issues

Node version compatible issue

Node version 12.x doesn't support require('fs/promises');,

so it has to be require('fs').promises; for both Node 12.x, 14.x.

Same for your 'readify' repo, but I'll not add issue for that and I hope to be fixed too.

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.