Socket
Socket
Sign inDemoInstall

ldjson-stream

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ldjson-stream - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

19

index.js

@@ -9,6 +9,19 @@ var through = require('through2')

function parse() {
return split(function(row) {
function parse(opts) {
opts = opts || {}
opts.strict = opts.strict !== false
function strict(row) {
if (row) return JSON.parse(row)
})
}
function nonStrict(row) {
try {
if (row) return JSON.parse(row)
} catch(e) {
// ignore
}
}
return opts.strict ? split(strict) : split(nonStrict)
}

@@ -15,0 +28,0 @@

4

package.json
{
"name": "ldjson-stream",
"version": "1.0.0",
"version": "1.1.0",
"description": "streaming line delimited json parser + serializer",

@@ -10,3 +10,3 @@ "main": "index.js",

"dependencies": {
"split2": "^0.1.1",
"split2": "^0.1.2",
"through2": "^0.5.1"

@@ -13,0 +13,0 @@ },

@@ -26,2 +26,4 @@ # ldjson-stream

If you want to discard non-valid JSON messages, you can call `ldj.parse({strict: false})`
usage:

@@ -28,0 +30,0 @@

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