copy-random

1.0.3 • Public • Published

copy-random

NPM version Build status

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

Package Sidebar

Install

npm i copy-random

Weekly Downloads

1

Version

1.0.3

License

MIT

Last publish

Collaborators

  • webcaetano