Safely, colorfully and informatively copy files without overwriting
- Copying files is sensitive operation with possible side-effects.
- Standard utilities do not sufficiently inform the user about what is going on.
- 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.
$ npm install --save gently-copy
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
:
= Begin copying files
- Copying file or directory: some-file
- Copying file or directory: some-dir
= End copying files
Type: string
or (array
of strings
)
Single or list of file and directory name(s).
Type: string
Destination directory name.
Type: object
To overwrite existing files, pass option = {overwrite: true}
MIT © Dmitri Zaitsev