stringify-object-transform
v1.0.3
Published
trivial JSON.stringify Transform for Objects
Downloads
5
Readme
stringify-object-transform.js
Trivial Transform wrapping JSON.stringify
for Object
output. Inputs are [key, value]
pairs. Outputs nothing for an empty Object
.
var StringifyObjectTransform = require('stringify-object-transform');
require('http').createServer(function(request, response) {
response.statusCode = 404;
// ...
.once('data', function() {
response.statusCode = 200;
response.setHeader('Content-Type', 'application/json');
})
.pipe(new StringifyObjectTransform())
.pipe(response);
});