Beta Shell
v2.0 ยท web2.us.cloudlogin.co
[FM]
[CMD]
[PHP]
[DB]
[INFO]
[SEC]
File Manager
~
/
usr
/
lib
/
node_modules
/
npm
/
node_modules
/
JSONStream
/
examples
Upload
3 items
Name
Size
Perms
Modified
Actions
[ .. / .. ]
all_docs.js
459 B
-rw-r--r--
2021-04-26 10:48:16
Edit
Del
Editing: all_docs.js
(459 B)
Path: /usr/lib/node_modules/npm/node_modules/JSONStream/examples/all_docs.js
Back
var request = require('request') , JSONStream = require('JSONStream') , es = require('event-stream') var parser = JSONStream.parse(['rows', true]) //emit parts that match this path (any element of the rows array) , req = request({url: 'http://isaacs.couchone.com/registry/_all_docs'}) , logger = es.mapSync(function (data) { //create a stream that logs to stderr, console.error(data) return data }) req.pipe(parser) parser.pipe(logger)