https://github.com/coderaiser/flop
:file_folder: FLOP - Folder operations module
https://github.com/coderaiser/flop
cloudcmd copy create directory folder move nodejs readify remove
Last synced: 6 months ago
JSON representation
:file_folder: FLOP - Folder operations module
- Host: GitHub
- URL: https://github.com/coderaiser/flop
- Owner: coderaiser
- License: mit
- Created: 2014-06-19T14:32:47.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2025-02-13T13:10:18.000Z (11 months ago)
- Last Synced: 2025-06-17T17:52:25.199Z (7 months ago)
- Topics: cloudcmd, copy, create, directory, folder, move, nodejs, readify, remove
- Language: JavaScript
- Homepage:
- Size: 168 KB
- Stars: 10
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: ChangeLog
- License: LICENSE
Awesome Lists containing this project
README
# Flop [![License][LicenseIMGURL]][LicenseURL] [![NPM version][NPMIMGURL]][NPMURL] [![Build Status][BuildStatusIMGURL]][BuildStatusURL]
[NPMIMGURL]: https://img.shields.io/npm/v/flop.svg?style=flat
[BuildStatusURL]: https://github.com/coderaiser/flop/actions?query=workflow%3A%22Node+CI%22 "Build Status"
[BuildStatusIMGURL]: https://github.com/coderaiser/flop/workflows/Node%20CI/badge.svg
[LicenseIMGURL]: https://img.shields.io/badge/license-MIT-317BF9.svg?style=flat
[NPMURL]: https://npmjs.org/package/flop "npm"
[LicenseURL]: https://tldrlegal.com/license/mit-license "MIT License"
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.
```js
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
```js
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
```js
const flop = require('flop');
await flop.copy('from', 'to');
```
### move
```js
const flop = require('flop');
await flop.move('from', 'to');
```
### remove
```js
await flop.remove('path/to/remove');
await flop.remove('path/to/remove', ['folder1', 'folder2']);
```
## License
MIT