https://github.com/webcaetano/copy-random
Copy random files
https://github.com/webcaetano/copy-random
Last synced: 6 months ago
JSON representation
Copy random files
- Host: GitHub
- URL: https://github.com/webcaetano/copy-random
- Owner: webcaetano
- License: mit
- Created: 2016-10-01T17:10:02.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-10-03T00:14:29.000Z (over 9 years ago)
- Last Synced: 2025-01-29T18:18:02.105Z (over 1 year ago)
- Language: JavaScript
- Size: 103 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# copy-random
[![NPM version][npm-image]][npm-url]
[![Build status][travis-image]][travis-url]
> Copy random files from a folder
## Installation
```
npm install copy-random --save
```
## Usage
```javascript
var cpyr = require('copy-random');
cpyr('./test/*.png','./test/output',3).then(function(){
})
```
## CLI
```
npm install copy-random -g
```
```
Usage
$ cpyr ...
Options
--no-overwrite Do not overwrite the destination
--parents Preserve path structure
--cwd= Working directory for files
--rename= Rename all filenames to
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
[npm-image]: https://img.shields.io/npm/v/copy-random.svg?style=flat-square
[npm-url]: https://npmjs.org/package/copy-random
[travis-image]: https://img.shields.io/travis/webcaetano/copy-random.svg?style=flat-square
[travis-url]: https://travis-ci.org/webcaetano/copy-random