V
V
vasIvas2014-07-30 23:06:39
JavaScript
vasIvas, 2014-07-30 23:06:39

How are threads arranged in gulp?

After a whole day of reading about node.js and gulp streams, I have at least some idea of ​​​​them in my head.
But these data are not enough to understand the minimum things, I hope you can explain to me.
I am interested in purely technical work, in three sentences, I think it will be enough.
But since we're talking about threads in gulp, can you explain how those threads go through its .pipe methods?
Today I started to understand and set the minimum task, to bypass the directory, collect the paths and write to a file. Created a task for this

gulp.src('path/dir/').pipe(test()).pipe(gulp.dest('path/file.extension'));

And for reasons unknown to me, the first one is executed
pipe(gulp.dest('path/file.extension'))
Why? Priorities?
And the most important question for me is how to get a reference to the stream in my test method?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2014-07-30
@vasIvas

https://github.com/wearefractal/vinyl-fs - read the docs...

Y
Yuri Puzynya, 2014-08-19
@3y3

I also advise you to master https://github.com/substack/stream-handbook

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question