{"_id":"peekaboo","_rev":"305934","name":"peekaboo","description":"Peekable transform stream","dist-tags":{"latest":"2.0.2"},"maintainers":[{"name":"hueniverse","email":"eran@hammer.io"}],"time":{"modified":"2021-06-03T19:31:40.000Z","created":"2014-11-08T03:29:27.741Z","2.0.2":"2016-07-28T19:08:05.338Z","2.0.1":"2016-05-21T01:26:40.106Z","2.0.0":"2015-11-02T05:36:38.161Z","1.0.0":"2014-11-08T03:29:27.741Z"},"users":{"simone.sanfra":true},"repository":{"type":"git","url":"git://github.com/hapijs/peekaboo.git"},"versions":{"2.0.2":{"name":"peekaboo","description":"Peekable transform stream","version":"2.0.2","repository":{"type":"git","url":"git://github.com/hapijs/peekaboo.git"},"main":"lib/index.js","keywords":["stream","transform","peek"],"engines":{"node":">=4.0.0"},"dependencies":{},"devDependencies":{"code":"3.x.x","lab":"10.x.x"},"scripts":{"test":"lab -a code -t 100 -L","test-cov-html":"lab -a code -r html -o coverage.html"},"license":"BSD-3-Clause","gitHead":"feef479470224dea028fc2b9641d2e5fc83b1287","bugs":{"url":"https://github.com/hapijs/peekaboo/issues"},"homepage":"https://github.com/hapijs/peekaboo#readme","_id":"peekaboo@2.0.2","_shasum":"fc42e139efd698c6ff2870a6b20c047cd9aa29ff","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.3.0","_npmUser":{"name":"hueniverse","email":"eran@hammer.io"},"dist":{"shasum":"fc42e139efd698c6ff2870a6b20c047cd9aa29ff","size":2221,"noattachment":false,"key":"/peekaboo/-/peekaboo-2.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/peekaboo/download/peekaboo-2.0.2.tgz"},"maintainers":[{"name":"hueniverse","email":"eran@hammer.io"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/peekaboo-2.0.2.tgz_1469732885115_0.2340644036885351"},"directories":{},"publish_time":1469732885338,"_cnpm_publish_time":1469732885338,"_hasShrinkwrap":false,"deprecated":"This module is no longer maintained."},"2.0.1":{"name":"peekaboo","description":"Peekable transform stream","version":"2.0.1","repository":{"type":"git","url":"git://github.com/hapijs/peekaboo.git"},"main":"lib/index.js","keywords":["stream","transform","peek"],"engines":{"node":">=4.0.0"},"dependencies":{},"devDependencies":{"code":"2.x.x","lab":"10.x.x"},"scripts":{"test":"lab -a code -t 100 -L","test-cov-html":"lab -a code -r html -o coverage.html"},"license":"BSD-3-Clause","gitHead":"0f2963a4e4a1b8d989efe2e98ee0776626fb5db3","bugs":{"url":"https://github.com/hapijs/peekaboo/issues"},"homepage":"https://github.com/hapijs/peekaboo#readme","_id":"peekaboo@2.0.1","_shasum":"1105f1a2eaae5d8fe9f089f6fee9a6602a82b2eb","_from":".","_npmVersion":"3.8.6","_nodeVersion":"5.11.1","_npmUser":{"name":"hueniverse","email":"eran@hammer.io"},"dist":{"shasum":"1105f1a2eaae5d8fe9f089f6fee9a6602a82b2eb","size":3405,"noattachment":false,"key":"/peekaboo/-/peekaboo-2.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/peekaboo/download/peekaboo-2.0.1.tgz"},"maintainers":[{"name":"hueniverse","email":"eran@hammer.io"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/peekaboo-2.0.1.tgz_1463793999671_0.18604592606425285"},"directories":{},"publish_time":1463794000106,"_cnpm_publish_time":1463794000106,"_hasShrinkwrap":false,"deprecated":"This module is no longer maintained."},"2.0.0":{"name":"peekaboo","description":"Peekable transform stream","version":"2.0.0","repository":{"type":"git","url":"git://github.com/hapijs/peekaboo.git"},"main":"lib/index.js","keywords":["stream","transform","peek"],"engines":{"node":">=4.0.0"},"dependencies":{},"devDependencies":{"code":"2.x.x","lab":"7.x.x"},"scripts":{"test":"lab -a code -t 100 -L","test-cov-html":"lab -a code -r html -o coverage.html"},"license":"BSD-3-Clause","gitHead":"a54ccbab2ac3434b2afb09b24de8e14c9797df91","bugs":{"url":"https://github.com/hapijs/peekaboo/issues"},"homepage":"https://github.com/hapijs/peekaboo#readme","_id":"peekaboo@2.0.0","_shasum":"8a54bbd68edeb0cb5b3144991e1535d2d492dc97","_from":".","_npmVersion":"3.3.9","_nodeVersion":"4.2.1","_npmUser":{"name":"hueniverse","email":"eran@hammer.io"},"dist":{"shasum":"8a54bbd68edeb0cb5b3144991e1535d2d492dc97","size":3374,"noattachment":false,"key":"/peekaboo/-/peekaboo-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/peekaboo/download/peekaboo-2.0.0.tgz"},"maintainers":[{"name":"hueniverse","email":"eran@hammer.io"}],"directories":{},"publish_time":1446442598161,"_cnpm_publish_time":1446442598161,"_hasShrinkwrap":false,"deprecated":"This module is no longer maintained."},"1.0.0":{"name":"peekaboo","description":"Peekable transform stream","version":"1.0.0","repository":{"type":"git","url":"git://github.com/hapijs/peekaboo"},"main":"index","keywords":["stream","transform","peek"],"engines":{"node":">=0.10.32"},"dependencies":{},"devDependencies":{"code":"1.x.x","lab":"5.x.x"},"scripts":{"test":"make test-cov"},"licenses":[{"type":"BSD","url":"http://github.com/hapijs/peekaboo/raw/master/LICENSE"}],"gitHead":"c8dcda2e0c2e8046eef647286bb7c2554ab4f03a","bugs":{"url":"https://github.com/hapijs/peekaboo/issues"},"homepage":"https://github.com/hapijs/peekaboo","_id":"peekaboo@1.0.0","_shasum":"c0db2926ad654d2ca01f7ca650ab4591a764fc42","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"hueniverse","email":"eran@hueniverse.com"},"maintainers":[{"name":"hueniverse","email":"eran@hammer.io"}],"dist":{"shasum":"c0db2926ad654d2ca01f7ca650ab4591a764fc42","size":3060,"noattachment":false,"key":"/peekaboo/-/peekaboo-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/peekaboo/download/peekaboo-1.0.0.tgz"},"directories":{},"publish_time":1415417367741,"_cnpm_publish_time":1415417367741,"_hasShrinkwrap":false,"deprecated":"This module is no longer maintained."}},"readme":"#peekaboo\r\n\r\nA Peekable node stream.\r\n\r\nA Peekaboo stream works just like a `PassThrough` stream, it can be piped to and from without any transformation of the chunks. The difference is that a Peekaboo stream will emit each chunk as a `peek` event on an EventEmitter of your choosing, letting you spy on stream chunks in an uninvasive way.\r\n\r\n[![Build Status](https://secure.travis-ci.org/hapijs/peekaboo.png)](http://travis-ci.org/hapijs/peekaboo)\r\n\r\nLead Maintainer - [Eran Hammer](https://github.com/hueniverse)\r\n\r\n## Example\r\n\r\nWe can report the download process of a request by peeking on response stream events:\r\n\r\n```javascript\r\n'use strict';\r\n\r\nconst Events = require('events');\r\nconst Fs = require('fs');\r\nconst Https = require('https');\r\nconst Peekaboo = require('peekaboo');\r\n\r\nconst emitter = new Events.EventEmitter();\r\nconst peek = new Peekaboo(emitter);\r\n\r\nHttps.get('https://codeload.github.com/hapijs/hapi/zip/master', (res) => {\r\n\r\n    res.pipe(peek).pipe(Fs.createWriteStream('./hapi.zip'));\r\n\r\n    let downloaded = 0;\r\n    emitter.on('peek', (chunk) => {\r\n\r\n        downloaded += chunk.length;\r\n        const pct = (downloaded / res.headers['content-length'] * 100).toFixed(1);\r\n        process.stdout.write(pct + '% downloaded\\r');\r\n    });\r\n});\r\n```\r\n","_attachments":{},"homepage":"https://github.com/hapijs/peekaboo#readme","bugs":{"url":"https://github.com/hapijs/peekaboo/issues"},"license":"BSD-3-Clause"}