[Pkg-javascript-commits] [node-jsonstream] 44/214: update docs

Bastien Roucariès rouca at moszumanska.debian.org
Fri Dec 1 12:58:37 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 2455339edcd572e073427e79f4c03b3bd75ef0bf
Author: Dominic Tarr <dominic.tarr at gmail.com>
Date:   Sun Jul 15 23:38:03 2012 +1200

    update docs
---
 readme.markdown | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/readme.markdown b/readme.markdown
index e96e69f..af6443c 100644
--- a/readme.markdown
+++ b/readme.markdown
@@ -43,8 +43,17 @@ usally, a json API will return a list of objects.
 `path` should be an array of property names, `RegExp`s, booleans, and/or functions.
 any object that matches the path will be emitted as 'data' (and `pipe`d down stream)
 
-if `path` is empty or null, or if no matches are made:  
-JSONStream.parse will only one 'data': the root object.
+if `path` is empty or null, JSONStream.parse will only one 'data': the root object.
+
+if `path` was supplied, but there where no matches for some reason (couchdb does this on an error)
+get the root like this:
+
+``` js
+var ps = JSONStream.parse()
+readable.pipe(js).on('end', function () {
+  ps.root //here is the root object.
+})
+```
 
 (this is useful when there is an error, because the error will probably not match your path)
 

-- 
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