Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mariocasciaro committed Apr 6, 2014
1 parent cb15b47 commit bf66756
Showing 1 changed file with 23 additions and 5 deletions.
28 changes: 23 additions & 5 deletions README.md
Expand Up @@ -10,7 +10,11 @@ Install with [npm](https://npmjs.org/package/gulp-clone).
npm install --save-dev gulp-clone
```

## Examples
## Changelog
* 1.0.0: **Breaking change** - There is a new operating mode, as explained in the 1st example. The old
operating mode is still available under the `clone.sink()` property.

## Example

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.

Expand All @@ -31,10 +35,24 @@ gulp.task('default', function () {
});
```

## License
##Example - Bypass mode

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

var cloneSink = clone.sink();

[MIT](http://en.wikipedia.org/wiki/MIT_License) @ Mario Casciaro
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
.pipe(gulp.dest('out/')); //<- saves bundle.js + original files in one pass
});
```

-----
## License

[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/mariocasciaro/gulp-clone/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
[MIT](http://en.wikipedia.org/wiki/MIT_License) @ Mario Casciaro

0 comments on commit bf66756

Please sign in to comment.