An open API service indexing awesome lists of open source software.

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

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