Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

JSONStream

Package Overview
Dependencies
Maintainers
1
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

JSONStream - npm Package Compare versions

Comparing version 0.0.0 to 0.1.0

test/parsejson.js

44

index.js

@@ -11,4 +11,2 @@

so i'll forgive him.

@@ -71,2 +69,4 @@ */

stream.write = function (chunk) {
if('string' === typeof chunk)
chunk = new Buffer(chunk)
parser.write(chunk)

@@ -82,2 +82,42 @@ }

return stream
}
exports.stringify = function (op, sep, cl) {
if (op === false){
op = ''
sep = '\n'
cl = ''
} else if (op == null) {
op = '[\n'
sep = '\n,\n'
cl = '\n]\n'
}
//else, what eve you like
var stream = new Stream ()
, first = true
, ended = false
stream.write = function (data) {
var json = JSON.stringify(data)
if(first) { first = false ; stream.emit('data', op + json)}
else stream.emit('data', sep + json)
}
stream.end = function (data) {
console.error('END ****************',JSON.stringify(cl))
if(ended)
return
ended = true
// if(data)
// stream.write(data)
stream.emit('data', cl)
stream.emit('end')
}
stream.writable = true
stream.readable = true
return stream
}

2

package.json
{ "name": "JSONStream"
, "version": "0.0.0"
, "version": "0.1.0"
, "description": "rawStream.pipe(JSONStream.parse()).pipe(streamOfObjects)"

@@ -4,0 +4,0 @@ , "homepage": "http://github.com/dominictarr/JSONStream"

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc