Skip to content

Commit

Permalink
Updated Async Callback Support Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
RnbWd committed Jun 30, 2014
1 parent d1481ec commit c4e4055
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,14 @@ Tasks can be made asynchronous if its `fn` does one of the following:
##### Accept a callback

```javascript
gulp.task('somename', function(cb) {
// Do stuff
cb(err);
// Run a command in a shell
var exec = require('child_process').exec;
gulp.task('jekyll', function(cb) {
// Build Jekyl
exec('jekyll build', function(err) {
if (err) return cb(err); //return error
cb(); // finished task
});
});
```

Expand Down

0 comments on commit c4e4055

Please sign in to comment.