https://github.com/dmitriz/gently-copy
Colorfully and informatively copy files without overwriting
https://github.com/dmitriz/gently-copy
Last synced: over 1 year ago
JSON representation
Colorfully and informatively copy files without overwriting
- Host: GitHub
- URL: https://github.com/dmitriz/gently-copy
- Owner: dmitriz
- License: mit
- Created: 2016-01-23T14:54:55.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2025-03-17T03:40:07.000Z (over 1 year ago)
- Last Synced: 2025-03-23T04:51:13.741Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 1.78 MB
- Stars: 5
- Watchers: 2
- Forks: 2
- Open Issues: 23
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gently-copy
Safely, colorfully and informatively copy files without overwriting
[](http://npm.im/gently-copy)
[](https://travis-ci.org/dmitriz/gently-copy)
[](https://david-dm.org/dmitriz/gently-copy)
[](http://makeapullrequest.com)
[](http://opensource.org/licenses/MIT)
[](https://www.npmjs.com/package/gently-copy)
[](https://github.com/feross/standard)
## Why?
- Copying files is sensitive operation with possible side-effects.
- Standard utilities do not sufficiently inform the user about what is going on.
## Features
- Safely copy files and directories without overwriting.
- Skip overwriting existing files, inform instead (or configure to overwrite instead with `option = {overwrite: true}`.
- Create new directories if needed.
- Clearly and colorfully inform about all actions peformed.
## Install
```sh
$ npm install --save gently-copy
```
## Usage
```js
var gentlyCopy = require('gently-copy')
var fileList = ['some-file', 'some-dir']
var dest = 'some-dest'
gentlyCopy(fileList, dest) // no overwriting (default)
gentlyCopy(fileList, dest, {overwrite: true}) // force overwriting
```
Console output with colors, thanks to the wonderful [`chalk`](https://github.com/chalk/chalk):
```sh
= Begin copying files
- Copying file or directory: some-file
- Copying file or directory: some-dir
= End copying files
```
## API
### gentlyCopy (source, destination, options)
#### source
Type: `string` or (`array` of `strings`)
Single or list of file and directory name(s).
#### destination
Type: `string`
Destination directory name.
#### options (optional)
Type: `object`
To overwrite existing files, pass `option = {overwrite: true}`
## License
MIT © [Dmitri Zaitsev](https://github.com/dmitriz)