Gulp pipe callback

Gulp pipe callback

I’ve spent the better part of the afternoon wrestling asynchronous issues in Gulp. I needed to concat a shitload of scripts and then after concat I needed to rename them to a certain name that couldn’t be done by simply using gulp-rename.

After many different solutions involving a bunch of promises and callbacks I finally decided to screw it all and make a general-purpose callback pipe

If you need to use this it’s very simple. First, create a folder in your node_modules folder titled gulp-callback and then inside that put a file in that directly called index.js

Like so:
 
Screenshot from 2014-07-30 15:48:39

Paste the following code in to your index.js file

Example usage

 

 Dave

About David Parlevliet

Dave is long time developer with a passion toward teaching. He divides his time between his wife, her cat and his projects. He recently started using twitter so make sure to follow him!