1. gulp-copy
Plugin copying files to a new destination and using that destination for other actions
gulp-copy
Package: gulp-copy
Created by: klaascuvelier
Last modified: Sat, 18 Jun 2022 16:50:44 GMT
Version: 4.0.1
License: MIT
Downloads: 96,442
Repository: https://github.com/klaascuvelier/gulp-copy

Install

npm install gulp-copy
yarn add gulp-copy

npm version
build status

gulp-copy

Copy source files to new destination and use that destination as new source (for further piping).
Automatically creates needed folders before proceeding. Ability to remove 'prefixes' from path.

Most likely you don't need this package for your gulp pipeline, a lot can be accomplished with just gulp.dest.
A reason to use this package would be to keep some depth (prefix options).

Usage

 // gulpfile.js

var gulpCopy = require('gulp-copy');
var otherGulpFunction = require('gulp-other-function');
var sourceFiles = ['source1/*', 'source2/*.txt'];
var destination = 'dest/';
var outputPath = 'some-other-dest/';

return gulp
    .src(sourceFiles)
    .pipe(gulpCopy(outputPath, options))
    .pipe(otherGulpFunction())
    .dest(destination);

Options

prefix: integer, defining how many parts of the path (separated by /) should be removed from the original path

Example

A simple implemention of a gulpfile using gulp-copy is available in the example folder.
You can run gulp or npx gulp from within the folder.

Updates

See changelog for all updates.

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code