[Pkg-javascript-commits] [node-jsonstream] 18/214: documented JSONStream.stringifyObject

Bastien Roucariès rouca at moszumanska.debian.org
Fri Dec 1 12:58:33 UTC 2017


This is an automated email from the git hooks/post-receive script.

rouca pushed a commit to branch master
in repository node-jsonstream.

commit d01ab32bfa73464c01c3b2905bc4acfd81da336a
Author: James Halliday <mail at substack.net>
Date:   Wed Feb 22 08:07:23 2012 -0800

    documented JSONStream.stringifyObject
---
 readme.markdown | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/readme.markdown b/readme.markdown
index 22bb92d..dcda955 100644
--- a/readme.markdown
+++ b/readme.markdown
@@ -92,7 +92,7 @@ Create a writable stream.
 
 you may pass in custom `open`, `close`, and `seperator` strings.  
 But, by default, `JSONStream.stringify()` will create an array,  
-(with default options `open='[\n', sep='\n,\n', cl='\n]\n'`)
+(with default options `open='[\n', sep='\n,\n', close='\n]\n'`)
 
 If you call `JSONStream.stringify(false)`   
 the elements will only be seperated by a newline.  
@@ -102,6 +102,16 @@ If you only write one item this will be valid JSON.
 If you write many items,  
 you can use a `RegExp` to split it into valid chunks.
 
+## JSONStream.stringifyObject(open, sep, close)
+
+Very much like `JSONStream.stringify`,
+but creates a writable stream for objects instead of arrays.
+
+Accordingly, `open='{\n', sep='\n,\n', close='\n}\n'`.
+
+When you `.write()` to the stream you must supply an array with `[ key, data ]`
+as the first argument.
+
 ## numbers
 
 There are occasional problems parsing and unparsing very precise numbers.  

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-jsonstream.git



More information about the Pkg-javascript-commits mailing list