Skip to content

Commit

Permalink
Change example
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed May 20, 2019
1 parent 89904b6 commit 97fa6aa
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions examples/stream.gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,10 @@
// Ignore the following line: this is only needed for internal purposes.
require('./utils.js')

const { src } = require('gulp')
const { src, dest } = require('gulp')
const { stream } = require('gulp-execa')
const through = require('through2')

module.exports.default = () =>
src('**/*')
// Prints the number of lines of each file
.pipe(stream(({ path }) => `wc -l ${path}`))
.pipe(
through.obj((file, encoding, func) => {
console.log(file.contents.toString())
func(null, file)
}),
)
.pipe(stream(({ path }) => `sort ${path}`))
.pipe(dest('sorted'))

0 comments on commit 97fa6aa

Please sign in to comment.