twolfson / grunt-curl

Download files from the internet via grunt.
The Unlicense
73 stars 28 forks source link

Add formatter option #11

Open twolfson opened 10 years ago

twolfson commented 10 years ago

Sometimes we receive data in a format than when we want to save it to disk. It can be usually it piped into another grunt task but not always. We should add a new option for this:

curl: {
  src: {...},
  dest: ...,
  formatter: function (res, body, cb) {
    cb(JSON.stringify(body));
  }
}

This issue was created as a side effect of #10

m4w commented 9 years ago

This would be still very helpful. Please add this function.