Comparing version 1.4.4 to 1.5.0
var through = require('through2') | ||
var split = require('split2') | ||
var EOL = require('os').EOL | ||
var stringify = require('json-stringify-safe') | ||
@@ -23,3 +24,3 @@ module.exports = parse | ||
return split(parseRow) | ||
return split(parseRow, opts) | ||
} | ||
@@ -29,4 +30,4 @@ | ||
return through.obj(opts, function(obj, enc, cb) { | ||
cb(null, JSON.stringify(obj) + EOL) | ||
cb(null, stringify(obj) + EOL) | ||
}) | ||
} |
{ | ||
"name": "ndjson", | ||
"version": "1.4.4", | ||
"version": "1.5.0", | ||
"description": "streaming newline delimited json parser + serializer", | ||
@@ -15,2 +15,3 @@ "main": "index.js", | ||
"dependencies": { | ||
"json-stringify-safe": "^5.0.1", | ||
"minimist": "^1.2.0", | ||
@@ -17,0 +18,0 @@ "split2": "^2.1.0", |
12
test.js
@@ -74,1 +74,13 @@ var test = require('tape') | ||
}) | ||
test('.serialize circular', function(t) { | ||
var serializer = ndj.serialize() | ||
serializer.pipe(concat(function(data) { | ||
t.equal(data, '{"obj":"[Circular ~]"}' + os.EOL) | ||
t.end() | ||
})) | ||
var obj = {} | ||
obj.obj = obj | ||
serializer.write(obj) | ||
serializer.end() | ||
}) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5342
118
4
+ Addedjson-stringify-safe@^5.0.1
+ Addedjson-stringify-safe@5.0.1(transitive)