stringify-array-transform
v1.0.4
Published
trivial JSON.stringify Transform for Arrays
Downloads
5
Readme
stringify-array-transform.js
Trivial Transform wrapping JSON.stringify
for Array
output. Outputs nothing for an empty Array
.
var StringifyArrayTransform = require('stringify-array-transform');
require('http').createServer(function(request, response) {
response.statusCode = 404;
// ...
.once('data', function() {
response.statusCode = 200;
response.setHeader('Content-Type', 'application/json');
})
.pipe(new StringifyArrayTransform())
.pipe(response);
});