streaming-json-stringify
Advanced tools
Comparing version 3.0.0 to 3.1.0
@@ -28,11 +28,13 @@ | ||
// Array Deliminator defaults | ||
// Array Deliminator and Stringifier defaults | ||
var opener = options && options.opener ? options.opener : '[\n' | ||
var seperator = options && options.seperator ? options.seperator : '\n,\n' | ||
var closer = options && options.closer ? options.closer : '\n]\n' | ||
var stringifier = options && options.stringifier ? options.stringifier : stringify | ||
// Array Deliminators | ||
// Array Deliminators and Stringifier | ||
this.opener = new Buffer(opener, 'utf8') | ||
this.seperator = new Buffer(seperator, 'utf8') | ||
this.closer = new Buffer(closer, 'utf8') | ||
this.stringifier = stringifier | ||
} | ||
@@ -55,3 +57,3 @@ | ||
doc = stringify(doc, this.replacer, this.space) | ||
doc = this.stringifier(doc, this.replacer, this.space) | ||
@@ -58,0 +60,0 @@ this.push(new Buffer(doc, 'utf8')) |
{ | ||
"name": "streaming-json-stringify", | ||
"description": "Streaming JSON.stringify()", | ||
"version": "3.0.0", | ||
"version": "3.1.0", | ||
"author": "Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)", | ||
@@ -9,5 +9,6 @@ "repository": "stream-utils/streaming-json-stringify", | ||
"devDependencies": { | ||
"cat-stream": "*", | ||
"istanbul": "0", | ||
"mocha": "2", | ||
"istanbul": "0", | ||
"cat-stream": "*" | ||
"sinon": "^1.17.2" | ||
}, | ||
@@ -14,0 +15,0 @@ "scripts": { |
@@ -47,2 +47,6 @@ # Streaming JSON.stringify() | ||
## Stringifier | ||
By default, [json-stringify-safe](https://www.npmjs.com/package/json-stringify-safe) is used to convert objects into strings. This can be configured with `options.stringifier`. | ||
## API | ||
@@ -66,2 +70,3 @@ | ||
stringify.closer = ']' | ||
stringify.stringifier = JSON.stringify | ||
``` | ||
@@ -68,0 +73,0 @@ |
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
6645
52
88
4