aws/aws-sdk-js — pull request #345 by lsegal (2014-08-28 21:47:41+00:00)
Title: Add support for AWS.HttpResponse.createUnbufferedStream()

Allow users to implement low-level streaming without `createReadStream()` when low-level access to headers is required. Note that the `createUnbufferedStream()` method must be called before `httpData` (`httpHeaders` at the latest).

```js
s3.getObject(params).on('httpHeaders', function(statusCode, headers) {
if (statusCode < 300) {
if (headers.etag === 'xyz') {
// pipe the stream, disabling buffered reading
this.response.httpResponse.createUnbufferedStream().pipe(process.stdout);
} else { // abort this request and set a better error message
this.abort();
this.response.error = new Error('Invalid ETag');
}
}
}).send(console.log);
```