colynb/gulp-data — pull request #3 by izaakschroeder (2014-07-30 02:07:58+00:00)
Title: Support for error handling and promises

Now you can have error handling in your callbacks (more in-line with standard node callbacks); you can also use promises in the same fashion gulp does which makes some patterns simpler. Appropriate tests have been added. Some examples of the new style follow.

Generate an error:
```javascript
data(function(cb) { cb('error') });
```

Return a successful result:
```javascript
data(function(cb) { cb(undefined, { hello: 'World' }) });
```

Use a promise from MongoDB:
```javascript
data(collections.findOne({ tag: 'test' }))
```

Use a promise from MongoDB within the callback:
```javascript
data(function(file) { return collections.find({ filename: path.basename(file.path) }); })
```