项目作者: coderaiser

项目描述 :
:file_folder: FLOP - Folder operations module
高级语言: JavaScript
项目地址: git://github.com/coderaiser/flop.git
创建时间: 2014-06-19T14:32:47Z
项目社区:https://github.com/coderaiser/flop

开源协议:MIT License

下载


Flop License NPM version Build Status

FLOP - Folder operations module.

Install

For use as application you could use global install.

  1. npm i flop -g

If you run flop -h you will see:

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

Also you can use flop as a module if install with

  1. npm i flop

API

create

Create new directory.

  1. const flop = require('flop');
  2. flop.create('./hello/world/from/flop', (error, data) => {
  3. console.log(error, data);
  4. });

read

Read content of directory with permisions and sizes.

Parameters:

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

Posible type:

  • raw
  • size
  • size raw
  1. const flop = require('flop');
  2. await flop.read('.');
  3. await flop.read('.', {
  4. sort: 'size',
  5. });
  6. await flop.read('.', 'raw');
  7. await flop.read('.', 'size');
  8. await flop.read('.', 'size raw');

copy

  1. const flop = require('flop');
  2. await flop.copy('from', 'to');

move

  1. const flop = require('flop');
  2. await flop.move('from', 'to');

remove

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

License

MIT