copy

Copy files or directories using globs.

copy

Copy files or directories using globs.

Install with npm

$ npm i copy --save
var copy = require('copy');

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);
});

copy

Asynchronously copy a glob of files from a to b.

Params

  • patterns {String|Array}: Glob pattern or array of glob patterns.
  • dest {String}: Destination directory
  • options {Object}: Options for [mkdirp] or [globby]. You may also pass a custom [rewrite] function on the options.
  • cb {Function}: Callback
  • err {Object}: [cb] Error object
  • files {Array}: [cb] Array of files

.sync

Synchronously copy a glob of files from a to b.

Params

  • patterns {String|Array}: Glob pattern or array of glob patterns.
  • dest {String}: Destination directory
  • options {Object}: Options for [mkdirp] or [globby]. You may also pass a custom [rewrite] function on the options.

.dir

Asynchronously and recursively copy all files in directory a to b.

Params

  • dirname {String}: Source directory
  • dest {String}: Destination directory
  • options {Object}: Options for [mkdirp]. You may also pass a custom [rewrite] function on the options.
  • cb {Function}: Callback
  • err {Object}: [cb] Error object
  • files {Array}: [cb] Array of files

.dirSync

Synchronously and recursively copy all files in directory a to b.

Params

  • dirname {String}: Source directory
  • dest {String}: Destination directory
  • options {Object}: Options for [mkdirp]. You may also pass a custom [rewrite] function on the options.

.one

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 path
  • dest {String}: Destination directory
  • options {Object}: Options for [mkdirp]. You may also pass a custom [rewrite] function on the options.
  • cb {Function}: Callback
  • err {Object}: [cb] Error object
  • files {Array}: [cb] Array of files

.oneSync

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 path
  • dest {String}: Destination directory
  • options {Object}: Options for [mkdirp]. You may also pass a custom [rewrite] function on the options.

.base

Base function for copying files.

Params

  • src {String}: Source file path
  • dest {String}: Destination directory
  • returns {String}

{%= related([]) %}

Install dev dependencies:

$ npm i -d && npm test

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue

Jon Schlinkert

Copyright © 2015 Jon Schlinkert Released under the MIT license.


This file was generated by verb-cli on July 03, 2015.