mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Package docs allow `false` as a parameter to `stringify`, in addition to `stringify(open, sep, close)`. This is useful for dumping a stream of objects separated by newlines, rather than creating a JSON array of the objects. from https://www.npmjs.com/package/JSONStream > If you call JSONStream.stringify(false) the elements will only be > seperated by a newline.
16 lines
362 B
TypeScript
16 lines
362 B
TypeScript
|
|
import json = require('jsonstream');
|
|
|
|
var read: NodeJS.ReadableStream;
|
|
var write: NodeJS.WritableStream;
|
|
|
|
read = read.pipe(json.parse('*'));
|
|
read = read.pipe(json.parse(['foo/*', 'bar/*']));
|
|
|
|
read = json.stringify();
|
|
read = json.stringify(false);
|
|
read = json.stringify('{', ',', '}');
|
|
|
|
read = json.stringifyObject();
|
|
read = json.stringifyObject('{', ',', '}');
|