Plato on Github
Report Home
node_modules/JSONStream/test/destroy_missing.js
Maintainability
78.90
Lines of code
27
Difficulty
10.41
Estimated Errors
0.25
Function weight
By Complexity
By SLOC
var fs = require ('fs'); var net = require('net'); var join = require('path').join; var file = join(__dirname, 'fixtures','all_npm.json'); var JSONStream = require('../'); var server = net.createServer(function(client) { var parser = JSONStream.parse([]); parser.on('end', function() { console.log('close') console.error('PASSED'); server.close(); }); client.pipe(parser); var n = 4 client.on('data', function () { if(--n) return client.end(); }) }); server.listen(9999); var client = net.connect({ port : 9999 }, function() { fs.createReadStream(file).pipe(client).on('data', console.log) //.resume(); });