An open API service indexing awesome lists of open source software.

https://github.com/dweinstein/json-stream-response

send the HTTP application/json header and stream a HTTP json response
https://github.com/dweinstein/json-stream-response

Last synced: about 2 months ago
JSON representation

send the HTTP application/json header and stream a HTTP json response

Awesome Lists containing this project

README

        

# SYNOPSIS

Stream a JSON response from an http server. Useful for when restify doesn't
send a content-type by default when you send a JSON stream through it... this
does.

# USAGE

```javascript
var jsr = require('json-stream-response');

function requestHandler(req, res, next) {
// ...
var ws = jsr(res);
ws.write(bigJSONThing);
ws.write(bigJSON2);
ws.end();
res.on('finish', next);
}
```