copy-random
v1.0.3
Published
Copy random files
Downloads
15
Maintainers
Readme
copy-random
Copy random files from a folder
Installation
npm install copy-random --save
Usage
var cpyr = require('copy-random');
cpyr('./test/*.png','./test/output',3).then(function(){
})
CLI
npm install copy-random -g
Usage
$ cpyr <source>... <destination> <size>
Options
--no-overwrite Do not overwrite the destination
--parents Preserve path structure
--cwd=<dir> Working directory for files
--rename=<filename> Rename all <source> filenames to <filename>
<source> can contain globs if quoted
Examples
Copy 3 random .png files in src folder into dist except src/goat.png
$ cpyr "src/*.png" "!src/goat.png" dist 3
Copy 3 random .html files inside src folder into dist and preserve path structure
$ cpyr "**/*.html" "../dist/" 3 --cwd=src --parents
License
MIT