copy
Copy files or directories using globs.
TODO
Install
Install with npm
$ npm i copy --save
Usage
var copy = require('copy');
Examples
Usage with [gulp]
In your project's gulpfile.js:
var gulp = require('gulp');
var copy = require('copy');
gulp.task('default', function (cb) {
copy('fixtures/*.txt', 'actual', cb);
});
API
Asynchronously copy a glob of files from a
to b
.
Params
patterns
{String|Array}: Glob pattern or array of glob patterns.dest
{String}: Destination directoryoptions
{Object}: Options for [mkdirp] or [globby]. You may also pass a custom [rewrite] function on the options.cb
{Function}: Callbackerr
{Object}: [cb] Error objectfiles
{Array}: [cb] Array of files
Synchronously copy a glob of files from a
to b
.
Params
patterns
{String|Array}: Glob pattern or array of glob patterns.dest
{String}: Destination directoryoptions
{Object}: Options for [mkdirp] or [globby]. You may also pass a custom [rewrite] function on the options.
Asynchronously and recursively copy all files in directory a
to b
.
Params
dirname
{String}: Source directorydest
{String}: Destination directoryoptions
{Object}: Options for [mkdirp]. You may also pass a custom [rewrite] function on the options.cb
{Function}: Callbackerr
{Object}: [cb] Error objectfiles
{Array}: [cb] Array of files
Synchronously and recursively copy all files in directory a
to b
.
Params
dirname
{String}: Source directorydest
{String}: Destination directoryoptions
{Object}: Options for [mkdirp]. You may also pass a custom [rewrite] function on the options.
Asynchronously copy a single file from a
to b
. A thin wrapper around the copy.base
method, to provide error reporting and to create directories when they
don't already exist.
Params
fp
{String}: Source file pathdest
{String}: Destination directoryoptions
{Object}: Options for [mkdirp]. You may also pass a custom [rewrite] function on the options.cb
{Function}: Callbackerr
{Object}: [cb] Error objectfiles
{Array}: [cb] Array of files
Synchronously copy a single file from a
to b
. A thin wrapper around the copy.base
method, to provide error reporting and to create directories when they
don't already exist.
Params
fp
{String}: Source file pathdest
{String}: Destination directoryoptions
{Object}: Options for [mkdirp]. You may also pass a custom [rewrite] function on the options.
Base function for copying files.
Params
src
{String}: Source file pathdest
{String}: Destination directoryreturns
{String}
Related projects
{%= related(['write', 'read-data', 'read-yaml', 'export-files']) %}
Running tests
Install dev dependencies:
$ npm i -d && npm test
Contributing
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue
Author
Jon Schlinkert
License
Copyright © 2015 Jon Schlinkert
Released under the MIT license.
This file was generated by verb-cli on July 03, 2015.