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
- Host: GitHub
- URL: https://github.com/dweinstein/json-stream-response
- Owner: dweinstein
- License: mit
- Created: 2015-04-08T23:53:43.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2015-04-09T00:03:59.000Z (about 10 years ago)
- Last Synced: 2025-02-12T05:43:51.496Z (3 months ago)
- Language: JavaScript
- Size: 133 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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);
}
```