https://github.com/hutsoninc/copy-to-range
Copy a file to a range of directories.
https://github.com/hutsoninc/copy-to-range
copy cp dir directory file files integer range
Last synced: 7 months ago
JSON representation
Copy a file to a range of directories.
- Host: GitHub
- URL: https://github.com/hutsoninc/copy-to-range
- Owner: hutsoninc
- License: mit
- Created: 2018-11-07T21:45:07.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-06-05T11:12:21.000Z (about 7 years ago)
- Last Synced: 2024-04-26T17:13:25.027Z (about 2 years ago)
- Topics: copy, cp, dir, directory, file, files, integer, range
- Language: JavaScript
- Homepage:
- Size: 256 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# copy-to-range
[](https://travis-ci.com/hutsoninc/copy-to-range) [](https://www.npmjs.com/package/copy-to-range)
Copy a file to a range of directories.
## Installation
`npm install --save copy-to-range`
## Usage
```js
const copyToRange = require('copy-to-range');
copyToRange('file.txt', '1-4');
```
```
$ tree
.
├── file.txt
├── 1
│ └── file.txt
├── 2
│ └── file.txt
├── 3
│ └── file.txt
├── 4
│ └── file.txt
│ ...
```
With options:
```js
const copyToRange = require('copy-to-range');
copyToRange('file.txt', '11-13,20', {
destination: 'out',
append: 'a',
prepend: 'p'
});
```
```
$ tree
.
├── file.txt
├── out
│ ├── p11a
│ │ └── file.txt
│ ├── p12a
│ │ └── file.txt
│ ├── p13a
│ │ └── file.txt
│ └── p20a
│ └── file.txt
│ ...
```
## Options
Property | Description | Default
--- | --- | ---
destination | Destination directory | `""`
append | String to append to directory names | `""`
prepend | String to prepend to directory names | `""`
## Related
- [copy-to-range-cli](https://github.com/hutsoninc/copy-to-range-cli) - CLI for this module
- [make-dir-range](https://github.com/hutsoninc/make-dir-range) - Make directories from a range of integers
- [move-to-range](https://github.com/hutsoninc/move-to-range) - Move files to corresponding directories given a range
## Authors
* **Austin Gordon** - *Development* - [GitHub](https://github.com/AustinLeeGordon)
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details