Skip to content

Instantly share code, notes, and snippets.

@raineorshine
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raineorshine/9109725 to your computer and use it in GitHub Desktop.
Save raineorshine/9109725 to your computer and use it in GitHub Desktop.
Cake vs Gulp

Cake

  • Doesn't output stdout or stderr of task commands automatically, so you have to do something like this:

     {print} = require 'util'
     {spawn} = require 'child_process'
     
     task 'build', 'Build js/ from src/', ->
     	coffee = spawn 'coffee', ['-c', '-o', 'js', 'src']
     	coffee.stderr.on 'data', (data) ->
     		process.stderr.write data.toString()
     	coffee.stdout.on 'data', (data) ->
     		print data.toString()
     	coffee.on 'exit', (code) ->
     		callback?() if code is 0
     
     task 'watch', 'Watch src/ for changes', ->
     	coffee = spawn 'coffee', ['-w', '-c', '-o', 'js', 'src']
     	coffee.stderr.on 'data', (data) ->
     		process.stderr.write data.toString()
     	coffee.stdout.on 'data', (data) ->
     		print data.toString()

(from Spine)

Gulp

  • streaming

Other: spawn Cake doesn't execute shell commands serially (there is surely an npm module for this)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment