node.js - What exactly does .pipe() mean in gulp? -
i relatively new gulp, , wondering .pipe()
in gulp task? i've gathered runs after return
, after .src
, there must more that. i've been unable find on web or in gulp's documentation , want understand i'm using.
edit found this, poor job of explaining it
from node docs:
https://nodejs.org/api/stream.html#stream_readable_pipe_destination_options
the readable.pipe() method attaches writable stream readable, causing switch automatically flowing mode , push of data attached writable. flow of data automatically managed destination writable stream not overwhelmed faster readable stream.
so in gulp can chain multiple tasks using pipe()
method. gulp makes use of streams. there readable , writeable streams. take following snippet example:
gulp.src(config.jssrc) .pipe(uglify()) .pipe(gulp.dest(config.dest + '/js')) .pipe(size());
gulp.src(...)
turns path @ config.jssrc
readable stream of data piping gulp-uglify
module. uglify task returns stream pipe our destination , on...
Comments
Post a Comment