Skip to content

Commit b5f9fc7

Browse files
committed
generate docs
1 parent a0cd82c commit b5f9fc7

File tree

2 files changed

+137
-29
lines changed

2 files changed

+137
-29
lines changed

.verb.md

+51-4
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,26 @@
1-
## breaking changes in v0.2.0!
2-
3-
The API has been simplified. Please review the API documentation below to see the new API.
4-
51
## Usage
62

73
```js
84
var copy = require('{%= name %}');
95
```
106

7+
See the [API documentation](#api) for usage details and available methods.
8+
119
## Examples
1210

11+
The main export is a function that takes:
12+
13+
- `src` - glob pattern or file path(s)
14+
- `dest` - the destination directory
15+
- `cb` - callback function
16+
17+
```js
18+
copy('*.js', 'foo', function(err, files) {
19+
if (err) throw err;
20+
// `files` is an array of the files that were copied
21+
});
22+
```
23+
1324
**Usage with [gulp][]**
1425

1526
In your project's gulpfile.js:
@@ -25,3 +36,39 @@ gulp.task('default', function (cb) {
2536

2637
## API
2738
{%= apidocs("index.js") %}
39+
40+
## CLI
41+
42+
To use the CLI, install `copy` globally with the following command:
43+
44+
```js
45+
$ npm install --global copy
46+
```
47+
48+
This adds `copy` to your system path, allowing the `copy` command to be executed anywhere.
49+
50+
**CLI usage**
51+
52+
```sh
53+
$ copy <patterns> <dir>
54+
```
55+
56+
- `patterns`: glob pattern or array of file paths
57+
- `dir`: destination directory
58+
59+
**Example**
60+
61+
Copy* all files with the `.js` extension to the `foo` directory
62+
63+
```sh
64+
$ copy *.js foo
65+
```
66+
67+
*Note that glob patterns may need to be wrapped in quotes depending on the shell you're using.
68+
69+
70+
## History
71+
72+
**v0.2.0 - breaking changes**
73+
74+
- The API was changed in 0.2.0. please review the [API documentation](#api)

README.md

+86-25
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,55 @@
1-
# copy [![NPM version](https://img.shields.io/npm/v/copy.svg)](https://www.npmjs.com/package/copy) [![Build Status](https://img.shields.io/travis/jonschlinkert/copy.svg)](https://travis-ci.org/jonschlinkert/copy)
1+
# copy [![NPM version](https://img.shields.io/npm/v/copy.svg?style=flat)](https://www.npmjs.com/package/copy) [![NPM downloads](https://img.shields.io/npm/dm/copy.svg?style=flat)](https://npmjs.org/package/copy) [![Build Status](https://img.shields.io/travis/jonschlinkert/copy.svg?style=flat)](https://travis-ci.org/jonschlinkert/copy)
22

3-
> Copy files or directories using globs.
3+
Copy files or directories using globs.
4+
5+
## TOC
6+
7+
- [Install](#install)
8+
- [Usage](#usage)
9+
- [Examples](#examples)
10+
- [API](#api)
11+
- [CLI](#cli)
12+
- [History](#history)
13+
- [Related projects](#related-projects)
14+
- [Contributing](#contributing)
15+
- [Building docs](#building-docs)
16+
- [Running tests](#running-tests)
17+
- [Author](#author)
18+
- [License](#license)
19+
20+
_(TOC generated by [verb](https://github.com/verbose/verb) using [markdown-toc](https://github.com/jonschlinkert/markdown-toc))_
421

522
## Install
623

724
Install with [npm](https://www.npmjs.com/):
825

926
```sh
10-
$ npm install copy --save
27+
$ npm install --save copy
1128
```
1229

13-
## breaking changes in v0.2.0!
14-
15-
The API has been simplified. Please review the API documentation below to see the new API.
16-
1730
## Usage
1831

1932
```js
2033
var copy = require('copy');
2134
```
2235

36+
See the [API documentation](#api) for usage details and available methods.
37+
2338
## Examples
2439

40+
The main export is a function that takes:
41+
42+
* `src` - glob pattern or file path(s)
43+
* `dest` - the destination directory
44+
* `cb` - callback function
45+
46+
```js
47+
copy('*.js', 'foo', function(err, files) {
48+
if (err) throw err;
49+
// `files` is an array of the files that were copied
50+
});
51+
```
52+
2553
**Usage with [gulp](http://gulpjs.com)**
2654

2755
In your project's gulpfile.js:
@@ -37,7 +65,7 @@ gulp.task('default', function (cb) {
3765

3866
## API
3967

40-
### [copy](index.js#L28)
68+
### [copy](index.js#L27)
4169

4270
Copy a filepath, vinyl file, array of files, or glob of files to the given destination `directory`, with `options` and callback function that exposes `err` and the array of vinyl files that are created by the copy operation.
4371

@@ -56,7 +84,7 @@ copy('*.js', 'dist', function(err, file) {
5684
});
5785
```
5886

59-
### [.copy.each](index.js#L76)
87+
### [.copy.each](index.js#L79)
6088

6189
Copy an array of files to the given destination `directory`, with `options` and callback function that exposes `err` and the array of vinyl files that are created by the copy operation.
6290

@@ -95,31 +123,64 @@ copy.one('foo.txt', 'dist', function(err, file) {
95123
});
96124
```
97125

98-
## Related projects
126+
## CLI
99127

100-
* [expand-config](https://www.npmjs.com/package/expand-config): Expand tasks, targets and files in a declarative configuration. | [homepage](https://github.com/jonschlinkert/expand-config)
101-
* [expand-files](https://www.npmjs.com/package/expand-files): Expand glob patterns in a declarative configuration into src-dest mappings. | [homepage](https://github.com/jonschlinkert/expand-files)
102-
* [expand-target](https://www.npmjs.com/package/expand-target): Expand target definitions in a declarative configuration. | [homepage](https://github.com/jonschlinkert/expand-target)
103-
* [expand-task](https://www.npmjs.com/package/expand-task): Expand and normalize task definitions in a declarative configuration. | [homepage](https://github.com/jonschlinkert/expand-task)
104-
* [export-files](https://www.npmjs.com/package/export-files): node.js utility for exporting a directory of files as modules. | [homepage](https://github.com/jonschlinkert/export-files)
105-
* [write](https://www.npmjs.com/package/write): Write files to disk, creating intermediate directories if they don't exist. | [homepage](https://github.com/jonschlinkert/write)
128+
To use the CLI, install `copy` globally with the following command:
106129

107-
## Contributing
130+
```js
131+
$ npm install --global copy
132+
```
108133

109-
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/copy/issues/new).
134+
This adds `copy` to your system path, allowing the `copy` command to be executed anywhere.
110135

111-
## Building docs
136+
**CLI usage**
112137

113-
Generate readme and API documentation with [verb](https://github.com/verbose/verb):
138+
```sh
139+
$ copy <patterns> <dir>
140+
```
141+
142+
* `patterns`: glob pattern or array of file paths
143+
* `dir`: destination directory
144+
145+
**Example**
146+
147+
Copy* all files with the `.js` extension to the `foo` directory
114148

115149
```sh
116-
$ npm install verb && npm run docs
150+
$ copy *.js foo
117151
```
118152

119-
Or, if [verb](https://github.com/verbose/verb) is installed globally:
153+
*Note that glob patterns may need to be wrapped in quotes depending on the shell you're using.
154+
155+
## History
156+
157+
**v0.2.0 - breaking changes**
158+
159+
* The API was changed in 0.2.0. please review the [API documentation](#api)
160+
161+
## Related projects
162+
163+
You might also be interested in these projects:
164+
165+
* [expand-config](https://www.npmjs.com/package/expand-config): Expand tasks, targets and files in a declarative configuration. | [homepage](https://github.com/jonschlinkert/expand-config "Expand tasks, targets and files in a declarative configuration.")
166+
* [expand-files](https://www.npmjs.com/package/expand-files): Expand glob patterns in a declarative configuration into src-dest mappings. | [homepage](https://github.com/jonschlinkert/expand-files "Expand glob patterns in a declarative configuration into src-dest mappings.")
167+
* [expand-target](https://www.npmjs.com/package/expand-target): Expand target definitions in a declarative configuration. | [homepage](https://github.com/jonschlinkert/expand-target "Expand target definitions in a declarative configuration.")
168+
* [expand-task](https://www.npmjs.com/package/expand-task): Expand and normalize task definitions in a declarative configuration. | [homepage](https://github.com/jonschlinkert/expand-task "Expand and normalize task definitions in a declarative configuration.")
169+
* [export-files](https://www.npmjs.com/package/export-files): node.js utility for exporting a directory of files as modules. | [homepage](https://github.com/jonschlinkert/export-files "node.js utility for exporting a directory of files as modules.")
170+
* [write](https://www.npmjs.com/package/write): Write files to disk, creating intermediate directories if they don't exist. | [homepage](https://github.com/jonschlinkert/write "Write files to disk, creating intermediate directories if they don't exist.")
171+
172+
## Contributing
173+
174+
This document was generated by [verb-readme-generator](https://github.com/verbose/verb-readme-generator) (a [verb](https://github.com/verbose/verb) generator), please don't edit directly. Any changes to the readme must be made in [.verb.md](.verb.md). See [Building Docs](#building-docs).
175+
176+
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). Or visit the [verb-readme-generator](https://github.com/verbose/verb-readme-generator) project to submit bug reports or pull requests for the readme layout template.
177+
178+
## Building docs
179+
180+
Generate readme and API documentation with [verb](https://github.com/verbose/verb):
120181

121182
```sh
122-
$ verb
183+
$ npm install -g verb verb-readme-generator && verb
123184
```
124185

125186
## Running tests
@@ -139,9 +200,9 @@ $ npm install -d && npm test
139200

140201
## License
141202

142-
Copyright © 2016 [Jon Schlinkert](https://github.com/jonschlinkert)
203+
Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert).
143204
Released under the [MIT license](https://github.com/jonschlinkert/copy/blob/master/LICENSE).
144205

145206
***
146207

147-
_This file was generated by [verb](https://github.com/verbose/verb), v0.9.0, on March 22, 2016._
208+
_This file was generated by [verb](https://github.com/verbose/verb), v0.9.0, on June 19, 2016._

0 commit comments

Comments
 (0)