felixge/node-combined-stream — pull request #14 by schnittstabil (2014-07-04 15:25:14+00:00)
Title: Allow append callbacks to fail silently.

First thank you for this great module. :+1:

**This PR allow one to do the following:**

```Javascript
combinedStream.append(function(next) {
fs.stat('file2.txt', function(err, stats) {
if (err || !stats.isFile()){
// don't append a stream:
next();
} else {
next(fs.createReadStream('file2.txt'));
}
});
});
```

**It also includes an enhanced "`undefined` and `null` as streams" treatment:**
```Javascript
combinedStream.append('foo'); // emits 'foo' (as usual)
combinedStream.append(null); // emits null
combinedStream.append(undefined); // emits undefined

combinedStream.append(function(next) {
next(undefined); // emits undefined (!)
});

combinedStream.append(function(next) {
next(); // don't emits undefined (!)
});

combinedStream.append(function(next) {
next(null); // emits null
});
```