{"_id":"stream-source","_rev":"3001293","name":"stream-source","description":"Read binary streams in chunks, on demand, with promises.","dist-tags":{"latest":"0.3.5"},"maintainers":[{"name":"mbostock","email":"mike@ocks.org"}],"time":{"modified":"2023-08-29T08:56:58.000Z","created":"2016-09-02T23:06:30.324Z","0.3.5":"2017-09-02T22:02:14.935Z","0.3.4":"2016-09-09T04:16:55.109Z","0.3.3":"2016-09-07T22:47:13.756Z","0.3.2":"2016-09-07T22:44:19.142Z","0.3.1":"2016-09-07T17:00:04.396Z","0.3.0":"2016-09-07T16:55:13.584Z","0.2.2":"2016-09-07T00:31:44.343Z","0.2.1":"2016-09-07T00:18:41.789Z","0.2.0":"2016-09-06T18:12:33.530Z","0.1.0":"2016-09-05T20:11:54.976Z","0.0.2":"2016-09-05T00:59:32.642Z","0.0.1":"2016-09-02T23:06:30.324Z"},"users":{},"author":{"name":"Mike Bostock","url":"https://bost.ocks.org/mike"},"repository":{"type":"git","url":"git+ssh://git@github.com/mbostock/stream-source.git"},"versions":{"0.3.5":{"name":"stream-source","version":"0.3.5","description":"Read binary streams in chunks, on demand, with promises.","keywords":["binary","stream","reader"],"homepage":"https://github.com/mbostock/stream-source","license":"BSD-3-Clause","author":{"name":"Mike Bostock","url":"https://bost.ocks.org/mike"},"unpkg":"dist/stream-source.js","jsdelivr":"dist/stream-source.js","main":"index.node.js","module":"index.js","repository":{"type":"git","url":"git+ssh://git@github.com/mbostock/stream-source.git"},"scripts":{"prepublishOnly":"rm -rf dist && mkdir dist && rollup -c --banner \"$(preamble)\" && uglifyjs -b beautify=false,preamble=\"'$(preamble)'\" -o dist/stream-source.min.js -c -m -- dist/stream-source.js","postpublish":"git push && git push --tags"},"devDependencies":{"package-preamble":"0.1","rollup":"0.49","uglify-js":"3"},"gitHead":"6370854836b8f9bd5644c5fe8bd9638cb9edcfd5","bugs":{"url":"https://github.com/mbostock/stream-source/issues"},"_id":"stream-source@0.3.5","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"mbostock","email":"mike@ocks.org"},"dist":{"shasum":"b97f52d0f8ea566db071db679b985403a31e0340","size":2783,"noattachment":false,"key":"/stream-source/-/stream-source-0.3.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/stream-source/download/stream-source-0.3.5.tgz"},"maintainers":[{"name":"mbostock","email":"mike@ocks.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/stream-source-0.3.5.tgz_1504389734836_0.12413435312919319"},"directories":{},"publish_time":1504389734935,"_hasShrinkwrap":false,"_cnpm_publish_time":1504389734935,"_cnpmcore_publish_time":"2021-12-16T15:36:39.018Z"},"0.3.4":{"name":"stream-source","version":"0.3.4","description":"Read binary streams in chunks, on demand, with promises.","keywords":["binary","stream","reader"],"homepage":"https://github.com/mbostock/stream-source","license":"BSD-3-Clause","author":{"name":"Mike Bostock","url":"https://bost.ocks.org/mike"},"browser":"dist/stream-source.js","main":"index.node.js","module":"index.js","repository":{"type":"git","url":"git+ssh://git@github.com/mbostock/stream-source.git"},"scripts":{"prepublish":"rm -rf dist && mkdir dist && rollup --banner \"$(preamble)\" -f umd -n sources.stream -o dist/stream-source.js -- index.js && uglifyjs --preamble \"$(preamble)\" -o dist/stream-source.min.js -cm -- dist/stream-source.js","postpublish":"git push && git push --tags"},"devDependencies":{"package-preamble":"0.0","rollup":"0.34","uglify-js":"2"},"gitHead":"881ca97c0d9898c3b703249bbca96e2a4521821e","bugs":{"url":"https://github.com/mbostock/stream-source/issues"},"_id":"stream-source@0.3.4","_shasum":"0427c1fb128b0bd2d884d868dcc894208f9bda3b","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.3.1","_npmUser":{"name":"mbostock","email":"mbostock@gmail.com"},"maintainers":[{"name":"mbostock","email":"mike@ocks.org"}],"dist":{"shasum":"0427c1fb128b0bd2d884d868dcc894208f9bda3b","size":2678,"noattachment":false,"key":"/stream-source/-/stream-source-0.3.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/stream-source/download/stream-source-0.3.4.tgz"},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/stream-source-0.3.4.tgz_1473394612833_0.6691070878878236"},"directories":{},"publish_time":1473394615109,"_hasShrinkwrap":false,"_cnpm_publish_time":1473394615109,"_cnpmcore_publish_time":"2021-12-16T15:36:39.412Z"},"0.3.3":{"name":"stream-source","version":"0.3.3","description":"Read binary streams in chunks, on demand, with promises.","keywords":["binary","stream","reader"],"homepage":"https://github.com/mbostock/stream-source","license":"BSD-3-Clause","author":{"name":"Mike Bostock","url":"https://bost.ocks.org/mike"},"browser":"dist/stream-source.js","main":"index.node.js","module":"index.js","repository":{"type":"git","url":"git+ssh://git@github.com/mbostock/stream-source.git"},"scripts":{"prepublish":"rm -rf dist && mkdir dist && rollup --banner \"$(preamble)\" -f umd -n sources.stream -o dist/stream-source.js -- index.js && uglifyjs --preamble \"$(preamble)\" -o dist/stream-source.min.js -cm -- dist/stream-source.js","postpublish":"git push && git push --tags"},"devDependencies":{"package-preamble":"0.0","rollup":"0.34","uglify-js":"2"},"gitHead":"808ce9ec6b399e6ca4e7617ba263b91a98cbb264","bugs":{"url":"https://github.com/mbostock/stream-source/issues"},"_id":"stream-source@0.3.3","_shasum":"f2ca1f9253a27e3ab3aa4e7bc62e3fa48993413a","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.3.1","_npmUser":{"name":"mbostock","email":"mbostock@gmail.com"},"maintainers":[{"name":"mbostock","email":"mike@ocks.org"}],"dist":{"shasum":"f2ca1f9253a27e3ab3aa4e7bc62e3fa48993413a","size":2656,"noattachment":false,"key":"/stream-source/-/stream-source-0.3.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/stream-source/download/stream-source-0.3.3.tgz"},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/stream-source-0.3.3.tgz_1473288431455_0.4805036673787981"},"directories":{},"publish_time":1473288433756,"_hasShrinkwrap":false,"_cnpm_publish_time":1473288433756,"_cnpmcore_publish_time":"2021-12-16T15:36:39.598Z"},"0.3.2":{"name":"stream-source","version":"0.3.2","description":"Read binary streams in chunks, on demand, with promises.","keywords":["binary","stream","reader"],"homepage":"https://github.com/mbostock/stream-source","license":"BSD-3-Clause","author":{"name":"Mike Bostock","url":"https://bost.ocks.org/mike"},"main":"index.node.js","module":"index.js","repository":{"type":"git","url":"git+ssh://git@github.com/mbostock/stream-source.git"},"scripts":{"postpublish":"git push && git push --tags"},"gitHead":"dd35348ebb3ed4918f03a31e73c0a96ba5a1b639","bugs":{"url":"https://github.com/mbostock/stream-source/issues"},"_id":"stream-source@0.3.2","_shasum":"020211509303f63c98db0d2e9b264103a41410cf","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.3.1","_npmUser":{"name":"mbostock","email":"mbostock@gmail.com"},"maintainers":[{"name":"mbostock","email":"mike@ocks.org"}],"dist":{"shasum":"020211509303f63c98db0d2e9b264103a41410cf","size":2192,"noattachment":false,"key":"/stream-source/-/stream-source-0.3.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/stream-source/download/stream-source-0.3.2.tgz"},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/stream-source-0.3.2.tgz_1473288256756_0.4965637014247477"},"directories":{},"publish_time":1473288259142,"_hasShrinkwrap":false,"_cnpm_publish_time":1473288259142,"_cnpmcore_publish_time":"2021-12-16T15:36:39.779Z"},"0.3.1":{"name":"stream-source","version":"0.3.1","description":"Read binary streams in chunks, on demand, with promises.","keywords":["binary","stream","reader"],"homepage":"https://github.com/mbostock/stream-source","license":"BSD-3-Clause","author":{"name":"Mike Bostock","url":"https://bost.ocks.org/mike"},"main":"index.js","repository":{"type":"git","url":"git+ssh://git@github.com/mbostock/stream-source.git"},"scripts":{"postpublish":"git push && git push --tags"},"gitHead":"e5983c1c475ef9ec0f142b9cf8e3f8f5a6ff856d","bugs":{"url":"https://github.com/mbostock/stream-source/issues"},"_id":"stream-source@0.3.1","_shasum":"711940f3c265e7a3587e3d22a63d41f090275633","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.3.1","_npmUser":{"name":"mbostock","email":"mbostock@gmail.com"},"maintainers":[{"name":"mbostock","email":"mike@ocks.org"}],"dist":{"shasum":"711940f3c265e7a3587e3d22a63d41f090275633","size":2106,"noattachment":false,"key":"/stream-source/-/stream-source-0.3.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/stream-source/download/stream-source-0.3.1.tgz"},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/stream-source-0.3.1.tgz_1473267602200_0.7022623792290688"},"directories":{},"publish_time":1473267604396,"_hasShrinkwrap":false,"_cnpm_publish_time":1473267604396,"_cnpmcore_publish_time":"2021-12-16T15:36:39.970Z"},"0.3.0":{"name":"stream-source","version":"0.3.0","description":"Read binary streams in chunks, on demand, with promises.","keywords":["binary","stream","reader"],"homepage":"https://github.com/mbostock/stream-source","license":"BSD-3-Clause","author":{"name":"Mike Bostock","url":"https://bost.ocks.org/mike"},"main":"index.js","repository":{"type":"git","url":"git+ssh://git@github.com/mbostock/stream-source.git"},"scripts":{"postpublish":"git push && git push --tags"},"gitHead":"44d866439e607f1ec50cec180ef3cc45b4879da2","bugs":{"url":"https://github.com/mbostock/stream-source/issues"},"_id":"stream-source@0.3.0","_shasum":"8e73391e40958394e6be988d85f5bf559f7e2d41","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.3.1","_npmUser":{"name":"mbostock","email":"mbostock@gmail.com"},"maintainers":[{"name":"mbostock","email":"mike@ocks.org"}],"dist":{"shasum":"8e73391e40958394e6be988d85f5bf559f7e2d41","size":2206,"noattachment":false,"key":"/stream-source/-/stream-source-0.3.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/stream-source/download/stream-source-0.3.0.tgz"},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/stream-source-0.3.0.tgz_1473267312458_0.7231041095219553"},"directories":{},"publish_time":1473267313584,"_hasShrinkwrap":false,"_cnpm_publish_time":1473267313584,"_cnpmcore_publish_time":"2021-12-16T15:36:40.174Z"},"0.2.2":{"name":"stream-source","version":"0.2.2","description":"Read binary streams in chunks, on demand, with promises.","keywords":["binary","stream","reader"],"homepage":"https://github.com/mbostock/stream-source","license":"BSD-3-Clause","author":{"name":"Mike Bostock","url":"https://bost.ocks.org/mike"},"main":"index.js","repository":{"type":"git","url":"git+ssh://git@github.com/mbostock/stream-source.git"},"scripts":{"postpublish":"git push && git push --tags"},"gitHead":"797dc53a8b0a97f31c2794cdc1e8932cab792a8a","bugs":{"url":"https://github.com/mbostock/stream-source/issues"},"_id":"stream-source@0.2.2","_shasum":"5965356ef4d0817a43fdc94a7e9e2b87f74daf71","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.3.1","_npmUser":{"name":"mbostock","email":"mbostock@gmail.com"},"maintainers":[{"name":"mbostock","email":"mike@ocks.org"}],"dist":{"shasum":"5965356ef4d0817a43fdc94a7e9e2b87f74daf71","size":2218,"noattachment":false,"key":"/stream-source/-/stream-source-0.2.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/stream-source/download/stream-source-0.2.2.tgz"},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/stream-source-0.2.2.tgz_1473208302447_0.40499555482529104"},"directories":{},"publish_time":1473208304343,"_hasShrinkwrap":false,"_cnpm_publish_time":1473208304343,"_cnpmcore_publish_time":"2021-12-16T15:36:40.388Z"},"0.2.1":{"name":"stream-source","version":"0.2.1","description":"Read binary streams in chunks, on demand, with promises.","keywords":["binary","stream","reader"],"homepage":"https://github.com/mbostock/stream-source","license":"BSD-3-Clause","author":{"name":"Mike Bostock","url":"https://bost.ocks.org/mike"},"main":"index.js","repository":{"type":"git","url":"git+ssh://git@github.com/mbostock/stream-source.git"},"scripts":{"postpublish":"git push && git push --tags"},"gitHead":"ad46dab5e50614a6a8bb09550cca2b8e7c12c69c","bugs":{"url":"https://github.com/mbostock/stream-source/issues"},"_id":"stream-source@0.2.1","_shasum":"8f01adbcc5ae00fde4d8beb9fa5bfb0a72161760","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.3.1","_npmUser":{"name":"mbostock","email":"mbostock@gmail.com"},"maintainers":[{"name":"mbostock","email":"mike@ocks.org"}],"dist":{"shasum":"8f01adbcc5ae00fde4d8beb9fa5bfb0a72161760","size":2134,"noattachment":false,"key":"/stream-source/-/stream-source-0.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/stream-source/download/stream-source-0.2.1.tgz"},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/stream-source-0.2.1.tgz_1473207519907_0.4298704795073718"},"directories":{},"publish_time":1473207521789,"_hasShrinkwrap":false,"_cnpm_publish_time":1473207521789,"_cnpmcore_publish_time":"2021-12-16T15:36:40.595Z"},"0.2.0":{"name":"stream-source","version":"0.2.0","description":"Read binary streams in chunks, on demand, with promises.","keywords":["binary","stream","reader"],"homepage":"https://github.com/mbostock/stream-source","license":"BSD-3-Clause","author":{"name":"Mike Bostock","url":"https://bost.ocks.org/mike"},"main":"index.js","repository":{"type":"git","url":"git+ssh://git@github.com/mbostock/stream-source.git"},"scripts":{"postpublish":"git push && git push --tags"},"gitHead":"bd9a49a7db05d36250d02b0b921a74fc6d9f3548","bugs":{"url":"https://github.com/mbostock/stream-source/issues"},"_id":"stream-source@0.2.0","_shasum":"a6796368ca754d9e066ee96502589e8efb42ab77","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.3.1","_npmUser":{"name":"mbostock","email":"mbostock@gmail.com"},"maintainers":[{"name":"mbostock","email":"mike@ocks.org"}],"dist":{"shasum":"a6796368ca754d9e066ee96502589e8efb42ab77","size":2079,"noattachment":false,"key":"/stream-source/-/stream-source-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/stream-source/download/stream-source-0.2.0.tgz"},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/stream-source-0.2.0.tgz_1473185551590_0.8264186934102327"},"directories":{},"publish_time":1473185553530,"_hasShrinkwrap":false,"_cnpm_publish_time":1473185553530,"_cnpmcore_publish_time":"2021-12-16T15:36:40.872Z"},"0.1.0":{"name":"stream-source","version":"0.1.0","description":"Read binary streams in chunks, on demand, with promises.","keywords":["binary","stream","reader"],"homepage":"https://github.com/mbostock/stream-source","license":"BSD-3-Clause","author":{"name":"Mike Bostock","url":"https://bost.ocks.org/mike"},"main":"index.js","repository":{"type":"git","url":"git+ssh://git@github.com/mbostock/stream-source.git"},"scripts":{"postpublish":"git push && git push --tags"},"gitHead":"f88787739962367ee45923b79fd576f97420f509","bugs":{"url":"https://github.com/mbostock/stream-source/issues"},"_id":"stream-source@0.1.0","_shasum":"f2dd9b76aa50458eb66ba7b271e3c05319497803","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.3.1","_npmUser":{"name":"mbostock","email":"mbostock@gmail.com"},"maintainers":[{"name":"mbostock","email":"mike@ocks.org"}],"dist":{"shasum":"f2dd9b76aa50458eb66ba7b271e3c05319497803","size":2039,"noattachment":false,"key":"/stream-source/-/stream-source-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/stream-source/download/stream-source-0.1.0.tgz"},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/stream-source-0.1.0.tgz_1473106314737_0.5591677254997194"},"directories":{},"publish_time":1473106314976,"_hasShrinkwrap":false,"_cnpm_publish_time":1473106314976,"_cnpmcore_publish_time":"2021-12-16T15:36:41.078Z"},"0.0.2":{"name":"stream-source","version":"0.0.2","description":"Read binary streams in chunks, on demand, with promises.","keywords":["binary","stream","reader"],"homepage":"https://github.com/mbostock/stream-source","license":"BSD-3-Clause","author":{"name":"Mike Bostock","url":"https://bost.ocks.org/mike"},"main":"index.js","repository":{"type":"git","url":"git+ssh://git@github.com/mbostock/stream-source.git"},"scripts":{"postpublish":"git push && git push --tags"},"gitHead":"8f022a30a6fc919f7a243c929e746cd9e382d05c","bugs":{"url":"https://github.com/mbostock/stream-source/issues"},"_id":"stream-source@0.0.2","_shasum":"6b8caaa4a0cc1109f8f4e6acce90ceeb0a2b38be","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.3.1","_npmUser":{"name":"mbostock","email":"mbostock@gmail.com"},"maintainers":[{"name":"mbostock","email":"mike@ocks.org"}],"dist":{"shasum":"6b8caaa4a0cc1109f8f4e6acce90ceeb0a2b38be","size":1905,"noattachment":false,"key":"/stream-source/-/stream-source-0.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/stream-source/download/stream-source-0.0.2.tgz"},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/stream-source-0.0.2.tgz_1473037172366_0.24143109912984073"},"directories":{},"publish_time":1473037172642,"_hasShrinkwrap":false,"_cnpm_publish_time":1473037172642,"_cnpmcore_publish_time":"2021-12-16T15:36:41.270Z"},"0.0.1":{"name":"stream-source","version":"0.0.1","description":"Read binary streams in chunks, on demand, with promises.","keywords":["binary","stream","reader"],"homepage":"https://github.com/mbostock/stream-source","license":"BSD-3-Clause","author":{"name":"Mike Bostock","url":"https://bost.ocks.org/mike"},"main":"index.js","repository":{"type":"git","url":"git+ssh://git@github.com/mbostock/stream-source.git"},"scripts":{"postpublish":"git push && git push --tags"},"gitHead":"415d4f12dcb5291215f8424bd9b2540610280491","bugs":{"url":"https://github.com/mbostock/stream-source/issues"},"_id":"stream-source@0.0.1","_shasum":"e6ec2cb472014726bea85321f144bf6fac5caf01","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.3.1","_npmUser":{"name":"mbostock","email":"mbostock@gmail.com"},"maintainers":[{"name":"mbostock","email":"mike@ocks.org"}],"dist":{"shasum":"e6ec2cb472014726bea85321f144bf6fac5caf01","size":395,"noattachment":false,"key":"/stream-source/-/stream-source-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/stream-source/download/stream-source-0.0.1.tgz"},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/stream-source-0.0.1.tgz_1472857590053_0.3913856919389218"},"directories":{},"publish_time":1472857590324,"_hasShrinkwrap":false,"_cnpm_publish_time":1472857590324,"_cnpmcore_publish_time":"2021-12-16T15:36:41.478Z"}},"readme":"# stream-source\n\nA [readable stream reader](https://streams.spec.whatwg.org/#readable-stream-reader) implementation on top of a Node [readable stream](https://nodejs.org/api/stream.html#stream_class_stream_readable). This library allows you to write code that takes a *source* as input, and can work with either native readable streams or Node streams. For example:\n\n```js\nvar stream = require(\"stream-source\");\n\nfunction read(source) {\n  return source.slice(40).then(value => {\n    if (value == null) return;\n    process.stdout.write(value);\n    return read(source);\n  });\n}\n\nread(stream(process.stdin))\n  .catch(error => console.error(error.stack));\n```\n\n## API Reference\n\n<a name=\"stream\" href=\"#stream\">#</a> <b>stream</b>(<i>stream</i>) [<>](https://github.com/mbostock/stream-source/blob/master/index.js#L1 \"Source\")\n<br><a href=\"#stream\">#</a> <b>stream</b>(<i>reader</i>)\n\nIn Node, returns a [sliceable](https://github.com/mbostock/slice-source) *source* for the specified Node [readable *stream*](https://nodejs.org/api/stream.html#stream_class_stream_readable). In a browser, if the specified *reader* exposes a *reader*.read method, it is assumed to be a [readable stream *reader*](https://streams.spec.whatwg.org/#readable-stream-reader), and the specified *reader* is returned as-is. Otherwise, the specified *reader* is assumed to be a [readable *stream*](https://streams.spec.whatwg.org/#rs), and the reader returned by *stream*.getReader is returned.\n\n<a name=\"source_slice\" href=\"#source_slice\">#</a> <i>source</i>.<b>slice</b>(<i>length</i>) [<>](https://github.com/mbostock/stream-source/blob/master/slice.js \"Source\")\n\nReturns a Promise for the next chunk of data from the underlying stream, yielding a [Uint8Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) (a [Buffer](https://nodejs.org/api/buffer.html)) of *length* bytes, or the remaining bytes of the underlying stream if the underlying stream has more than zero but fewer than *length* bytes remaining, or null when no bytes remain in the stream.\n\n<a name=\"source_read\" href=\"#source_read\">#</a> <i>source</i>.<b>read</b>() [<>](https://github.com/mbostock/stream-source/blob/master/read.js \"Source\")\n\nReturns a Promise for the next chunk of data from the underlying stream. The yielded result is an object with the following properties:\n\n* `value` - a [Uint8Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) (a [Buffer](https://nodejs.org/api/buffer.html)), or undefined if the stream ended\n* `done` - a boolean which is true if the stream ended\n\n<a name=\"source_cancel\" href=\"#source_cancel\">#</a> <i>source</i>.<b>cancel</b>() [<>](https://github.com/mbostock/slice-source/blob/master/cancel.js \"Source\")\n\nReturns a Promise which is resolved when the underlying stream has been destroyed.\n","_attachments":{},"homepage":"https://github.com/mbostock/stream-source","bugs":{"url":"https://github.com/mbostock/stream-source/issues"},"license":"BSD-3-Clause"}