JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 108889
  • Score
    100M100P100Q150157F

Clone files in memory in a gulp stream

Package Exports

  • gulp-clone

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (gulp-clone) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

gulp-clone Build Status NPM version Dependency Status

Duplicate files in memory.

Install

Install with npm.

npm install --save-dev gulp-clone

Examples

gulp-clone is useful in all those situations where you perform a destructive operation on your files (as for example concat) and you want to keep your original files for further processing or saving...everything in just one stream pass.

var gulp = require('gulp');
var concat = require('gulp-concat');
var clone = require('gulp-clone');

var cloneSink = clone();

gulp.task('default', function () {
    gulp.src('assets/**/*.js')
        .pipe(cloneSink)                //<- clone objects streaming through this point
        .pipe(concat("bundle.js"))
        .pipe(cloneSink.tap())          //<- output cloned objects + bundle.js
        .gulp.dest('out/');             //<- saves bundle.js + original files in one pass
});

License

MIT @ Mario Casciaro