You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
_(TOC generated by [verb](https://github.com/verbose/verb) using [markdown-toc](https://github.com/jonschlinkert/markdown-toc))_
4
21
5
22
## Install
6
23
7
24
Install with [npm](https://www.npmjs.com/):
8
25
9
26
```sh
10
-
$ npm install copy --save
27
+
$ npm install --save copy
11
28
```
12
29
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
-
17
30
## Usage
18
31
19
32
```js
20
33
var copy =require('copy');
21
34
```
22
35
36
+
See the [API documentation](#api) for usage details and available methods.
37
+
23
38
## Examples
24
39
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
+
25
53
**Usage with [gulp](http://gulpjs.com)**
26
54
27
55
In your project's gulpfile.js:
@@ -37,7 +65,7 @@ gulp.task('default', function (cb) {
37
65
38
66
## API
39
67
40
-
### [copy](index.js#L28)
68
+
### [copy](index.js#L27)
41
69
42
70
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.
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.
*[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:
106
129
107
-
## Contributing
130
+
```js
131
+
$ npm install --global copy
132
+
```
108
133
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.
110
135
111
-
## Building docs
136
+
**CLI usage**
112
137
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
114
148
115
149
```sh
116
-
$ npm install verb && npm run docs
150
+
$ copy *.js foo
117
151
```
118
152
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):
0 commit comments