{"_id":"multibuffer","_rev":"4665397","name":"multibuffer","description":"Package Arrays of Buffers into a single buffer that they can be later unpacked from.","dist-tags":{"latest":"2.2.3"},"maintainers":[{"name":"bryce","email":""}],"time":{"modified":"2026-04-10T22:37:46.000Z","created":"2013-09-28T20:58:15.139Z","2.2.3":"2014-08-22T16:21:59.740Z","2.2.2":"2014-08-22T16:16:21.137Z","2.2.1":"2014-01-31T00:40:49.358Z","2.2.0":"2013-12-18T23:47:53.656Z","2.1.1":"2013-12-13T21:10:25.776Z","2.0.0":"2013-10-10T23:07:04.510Z","1.3.1":"2013-10-04T20:35:12.460Z","1.3.0":"2013-10-04T00:24:12.851Z","1.2.2":"2013-10-01T05:45:26.641Z","1.2.1":"2013-10-01T04:24:46.407Z","1.2.0":"2013-10-01T04:17:40.108Z","1.1.0":"2013-10-01T03:17:23.128Z","1.0.0":"2013-09-28T20:58:15.139Z"},"users":{},"author":{"name":"Bryce B. Baril"},"repository":{"type":"git","url":"git://github.com/brycebaril/multibuffer.git"},"versions":{"2.2.3":{"name":"multibuffer","version":"2.2.3","description":"Package Arrays of Buffers into a single buffer that they can be later unpacked from.","main":"index.js","directories":{"test":"test"},"dependencies":{"varint":"^3.0.1"},"devDependencies":{"tape":"~2.14.0","terminus":"~1.0.10","through2":"~0.6.1","binary-csv":"0.2.2","stream-splice":"~1.0.8"},"scripts":{"test":"node test/"},"keywords":["Buffers","Concat","pack","unpack","encode"],"author":{"name":"Bryce B. Baril"},"license":"MIT","repository":{"type":"git","url":"git://github.com/brycebaril/multibuffer.git"},"bugs":{"url":"https://github.com/brycebaril/multibuffer/issues"},"gitHead":"ededac93ab213c743b2ee81623532bee9b0d5195","homepage":"https://github.com/brycebaril/multibuffer","_id":"multibuffer@2.2.3","_shasum":"cf62c10ff1a412b6ac51ebc98c4d950004997e3b","_from":".","_npmVersion":"1.4.14","_npmUser":{"name":"bryce","email":"bryce@ravenwall.com"},"maintainers":[{"name":"bryce","email":""}],"dist":{"shasum":"cf62c10ff1a412b6ac51ebc98c4d950004997e3b","size":2929,"noattachment":false,"key":"/multibuffer/-/multibuffer-2.2.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/multibuffer/download/multibuffer-2.2.3.tgz"},"publish_time":1408724519740,"_hasShrinkwrap":false,"_cnpm_publish_time":1408724519740,"_cnpmcore_publish_time":"2021-12-16T22:24:24.647Z"},"2.2.2":{"name":"multibuffer","version":"2.2.2","description":"Package Arrays of Buffers into a single buffer that they can be later unpacked from.","main":"index.js","directories":{"test":"test"},"dependencies":{"varint":"^3.0.1"},"devDependencies":{"tape":"~2.4.0","terminus":"~1.0.9","through2":"~0.4.1","binary-csv":"0.1.6","stream-splice":"~1.0.7"},"scripts":{"test":"node test/"},"keywords":["Buffers","Concat","pack","unpack","encode"],"author":{"name":"Bryce B. Baril"},"license":"MIT","repository":{"type":"git","url":"git://github.com/brycebaril/multibuffer.git"},"bugs":{"url":"https://github.com/brycebaril/multibuffer/issues"},"gitHead":"38f29f1a2e9db2e39f10090dbf1547307457a0c5","homepage":"https://github.com/brycebaril/multibuffer","_id":"multibuffer@2.2.2","_shasum":"c41bf373b48299eb22b5aebaa18478d1c7305372","_from":".","_npmVersion":"1.4.14","_npmUser":{"name":"bryce","email":"bryce@ravenwall.com"},"maintainers":[{"name":"bryce","email":""}],"dist":{"shasum":"c41bf373b48299eb22b5aebaa18478d1c7305372","size":2967,"noattachment":false,"key":"/multibuffer/-/multibuffer-2.2.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/multibuffer/download/multibuffer-2.2.2.tgz"},"publish_time":1408724181137,"_hasShrinkwrap":false,"_cnpm_publish_time":1408724181137,"_cnpmcore_publish_time":"2021-12-16T22:24:24.841Z"},"2.2.1":{"name":"multibuffer","version":"2.2.1","description":"Package Arrays of Buffers into a single buffer that they can be later unpacked from.","main":"index.js","directories":{"test":"test"},"dependencies":{"varint":"~1.0.0"},"devDependencies":{"tape":"~2.4.0","terminus":"~1.0.9","through2":"~0.4.1","binary-csv":"0.1.6","stream-splice":"~1.0.7"},"scripts":{"test":"node test/"},"keywords":["Buffers","Concat","pack","unpack","encode"],"author":{"name":"Bryce B. Baril"},"license":"MIT","repository":{"type":"git","url":"git://github.com/brycebaril/multibuffer.git"},"bugs":{"url":"https://github.com/brycebaril/multibuffer/issues"},"homepage":"https://github.com/brycebaril/multibuffer","_id":"multibuffer@2.2.1","dist":{"shasum":"db641ff1745682c6fc3b96cf978f9335767d1bef","size":2966,"noattachment":false,"key":"/multibuffer/-/multibuffer-2.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/multibuffer/download/multibuffer-2.2.1.tgz"},"_from":".","_npmVersion":"1.3.24","_npmUser":{"name":"bryce","email":"bryce@ravenwall.com"},"maintainers":[{"name":"bryce","email":""}],"publish_time":1391128849358,"_hasShrinkwrap":false,"_cnpm_publish_time":1391128849358,"_cnpmcore_publish_time":"2021-12-16T22:24:25.046Z"},"2.2.0":{"name":"multibuffer","version":"2.2.0","description":"Package Arrays of Buffers into a single buffer that they can be later unpacked from.","main":"index.js","directories":{"test":"test"},"dependencies":{"varint":"~1.0.0"},"devDependencies":{"tape":"~2.3.0","terminus":"~1.0.4","through2":"~0.2.3","binary-csv":"0.1.6","stream-splice":"~1.0.7"},"scripts":{"test":"node test/"},"keywords":["Buffers","Concat","pack","unpack","encode"],"author":{"name":"Bryce B. Baril"},"license":"MIT","repository":{"type":"git","url":"git://github.com/brycebaril/multibuffer.git"},"bugs":{"url":"https://github.com/brycebaril/multibuffer/issues"},"readmeFilename":"README.md","homepage":"https://github.com/brycebaril/multibuffer","_id":"multibuffer@2.2.0","dist":{"shasum":"6fe88383ac925b583accf70e42621671f52f7256","size":2989,"noattachment":false,"key":"/multibuffer/-/multibuffer-2.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/multibuffer/download/multibuffer-2.2.0.tgz"},"_from":".","_npmVersion":"1.3.21","_npmUser":{"name":"bryce","email":"bryce@ravenwall.com"},"maintainers":[{"name":"bryce","email":""}],"publish_time":1387410473656,"_hasShrinkwrap":false,"_cnpm_publish_time":1387410473656,"_cnpmcore_publish_time":"2021-12-16T22:24:25.243Z"},"2.1.1":{"name":"multibuffer","version":"2.1.1","description":"Package Arrays of Buffers into a single buffer that they can be later unpacked from.","main":"index.js","directories":{"test":"test"},"dependencies":{"bops":"~0.1.1","varint":"~1.0.0"},"devDependencies":{"tape":"~2.3.0","terminus":"~1.0.4","through2":"~0.2.3","binary-csv":"0.1.6","stream-splice":"~1.0.7"},"scripts":{"test":"node test/"},"keywords":["Buffers","Concat","pack","unpack","encode"],"author":{"name":"Bryce B. Baril"},"license":"MIT","repository":{"type":"git","url":"git://github.com/brycebaril/multibuffer.git"},"bugs":{"url":"https://github.com/brycebaril/multibuffer/issues"},"readmeFilename":"README.md","homepage":"https://github.com/brycebaril/multibuffer","_id":"multibuffer@2.1.1","dist":{"shasum":"7fc81b27c767d0790c9a3d2cdefb3dcd1a174aaf","size":3017,"noattachment":false,"key":"/multibuffer/-/multibuffer-2.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/multibuffer/download/multibuffer-2.1.1.tgz"},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"bryce","email":"bryce@ravenwall.com"},"maintainers":[{"name":"bryce","email":""}],"publish_time":1386969025776,"_hasShrinkwrap":false,"_cnpm_publish_time":1386969025776,"_cnpmcore_publish_time":"2021-12-16T22:24:25.422Z"},"2.0.0":{"name":"multibuffer","version":"2.0.0","description":"Package Arrays of Buffers into a single buffer that they can be later unpacked from.","main":"index.js","directories":{"test":"test"},"dependencies":{"bops":"~0.1.0","varint":"~1.0.0"},"devDependencies":{"tape":"~1.1.1","terminus":"~1.0.2","through2":"~0.2.3","binary-csv":"0.0.5","stream-splice":"~1.0.6"},"scripts":{"test":"node test/"},"keywords":["Buffers","Concat","pack","unpack","encode"],"author":{"name":"Bryce B. Baril"},"license":"MIT","repository":{"type":"git","url":"git://github.com/brycebaril/multibuffer.git"},"bugs":{"url":"https://github.com/brycebaril/multibuffer/issues"},"readmeFilename":"README.md","_id":"multibuffer@2.0.0","dist":{"shasum":"85a253835cd9925e5591b61a502ceccd7020cc96","size":2900,"noattachment":false,"key":"/multibuffer/-/multibuffer-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/multibuffer/download/multibuffer-2.0.0.tgz"},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"bryce","email":"bryce@ravenwall.com"},"maintainers":[{"name":"bryce","email":""}],"publish_time":1381446424510,"_hasShrinkwrap":false,"_cnpm_publish_time":1381446424510,"_cnpmcore_publish_time":"2021-12-16T22:24:25.967Z"},"1.3.1":{"name":"multibuffer","version":"1.3.1","description":"Package Arrays of Buffers into a single buffer that they can be later unpacked from.","main":"index.js","directories":{"test":"test"},"dependencies":{"bops":"0.1.0"},"devDependencies":{"tape":"~1.1.1","terminus":"~1.0.2","through2":"~0.2.3","binary-csv":"0.0.4","stream-splice":"~1.0.6"},"scripts":{"test":"node test/"},"keywords":["Buffers","Concat","pack","unpack","encode"],"author":{"name":"Bryce B. Baril"},"license":"MIT","repository":{"type":"git","url":"git://github.com/brycebaril/multibuffer.git"},"bugs":{"url":"https://github.com/brycebaril/multibuffer/issues"},"readmeFilename":"README.md","_id":"multibuffer@1.3.1","dist":{"shasum":"3d2af0d255e71846813aeaaf14eea725d44920c3","size":2794,"noattachment":false,"key":"/multibuffer/-/multibuffer-1.3.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/multibuffer/download/multibuffer-1.3.1.tgz"},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"bryce","email":"bryce@ravenwall.com"},"maintainers":[{"name":"bryce","email":""}],"publish_time":1380918912460,"_hasShrinkwrap":false,"_cnpm_publish_time":1380918912460,"_cnpmcore_publish_time":"2021-12-16T22:24:26.165Z"},"1.3.0":{"name":"multibuffer","version":"1.3.0","description":"Package Arrays of Buffers into a single buffer that they can be later unpacked from.","main":"index.js","directories":{"test":"test"},"dependencies":{"bops":"0.1.0"},"devDependencies":{"tape":"~1.1.1","terminus":"~1.0.2","through2":"~0.2.3","binary-csv":"0.0.4","stream-splice":"~1.0.6"},"scripts":{"test":"node test/"},"keywords":["Buffers","Concat","pack","unpack","encode"],"author":{"name":"Bryce B. Baril"},"license":"MIT","repository":{"type":"git","url":"git://github.com/brycebaril/multibuffer.git"},"bugs":{"url":"https://github.com/brycebaril/multibuffer/issues"},"readmeFilename":"README.md","_id":"multibuffer@1.3.0","dist":{"shasum":"5299b6d202eb2573e004959817917c984b66b1b2","size":2818,"noattachment":false,"key":"/multibuffer/-/multibuffer-1.3.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/multibuffer/download/multibuffer-1.3.0.tgz"},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"bryce","email":"bryce@ravenwall.com"},"maintainers":[{"name":"bryce","email":""}],"publish_time":1380846252851,"_hasShrinkwrap":false,"_cnpm_publish_time":1380846252851,"_cnpmcore_publish_time":"2021-12-16T22:24:26.359Z"},"1.2.2":{"name":"multibuffer","version":"1.2.2","description":"Package Arrays of Buffers into a single buffer that they can be later unpacked from.","main":"index.js","directories":{"test":"test"},"dependencies":{"bops":"0.1.0"},"devDependencies":{"tape":"~1.1.1"},"scripts":{"test":"node test/"},"keywords":["Buffers","Concat","pack","unpack","encode"],"author":{"name":"Bryce B. Baril"},"license":"MIT","repository":{"type":"git","url":"git://github.com/brycebaril/multibuffer.git"},"bugs":{"url":"https://github.com/brycebaril/multibuffer/issues"},"readmeFilename":"README.md","_id":"multibuffer@1.2.2","dist":{"shasum":"ce2afdbb0cb45193c052c883b35f8e618c836efa","size":2673,"noattachment":false,"key":"/multibuffer/-/multibuffer-1.2.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/multibuffer/download/multibuffer-1.2.2.tgz"},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"bryce","email":"bryce@ravenwall.com"},"maintainers":[{"name":"bryce","email":""}],"publish_time":1380606326641,"_hasShrinkwrap":false,"_cnpm_publish_time":1380606326641,"_cnpmcore_publish_time":"2021-12-16T22:24:26.588Z"},"1.2.1":{"name":"multibuffer","version":"1.2.1","description":"Package Arrays of Buffers into a single buffer that they can be later unpacked from.","main":"index.js","directories":{"test":"test"},"dependencies":{"bops":"0.1.0"},"devDependencies":{"tape":"~1.1.1"},"scripts":{"test":"node test/"},"keywords":["Buffers","Concat","pack","unpack","encode"],"author":{"name":"Bryce B. Baril"},"license":"MIT","repository":{"type":"git","url":"git://github.com/brycebaril/multibuffer.git"},"bugs":{"url":"https://github.com/brycebaril/multibuffer/issues"},"readmeFilename":"README.md","_id":"multibuffer@1.2.1","dist":{"shasum":"93ba0f7eb6ea9917f02b43bbb2afe72b9cb6dc8e","size":2663,"noattachment":false,"key":"/multibuffer/-/multibuffer-1.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/multibuffer/download/multibuffer-1.2.1.tgz"},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"bryce","email":"bryce@ravenwall.com"},"maintainers":[{"name":"bryce","email":""}],"publish_time":1380601486407,"_hasShrinkwrap":false,"_cnpm_publish_time":1380601486407,"_cnpmcore_publish_time":"2021-12-16T22:24:26.797Z"},"1.2.0":{"name":"multibuffer","version":"1.2.0","description":"Package Arrays of Buffers into a single buffer that they can be later unpacked from.","main":"index.js","directories":{"test":"test"},"dependencies":{"bops":"0.1.0"},"devDependencies":{"tape":"~1.1.1"},"scripts":{"test":"node test/"},"keywords":["Buffers","Concat","pack","unpack","encode"],"author":{"name":"Bryce B. Baril"},"license":"MIT","repository":{"type":"git","url":"git://github.com/brycebaril/multibuffer.git"},"bugs":{"url":"https://github.com/brycebaril/multibuffer/issues"},"readmeFilename":"README.md","_id":"multibuffer@1.2.0","dist":{"shasum":"859a86aae0aef4baa11c398f059998729413464a","size":2656,"noattachment":false,"key":"/multibuffer/-/multibuffer-1.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/multibuffer/download/multibuffer-1.2.0.tgz"},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"bryce","email":"bryce@ravenwall.com"},"maintainers":[{"name":"bryce","email":""}],"publish_time":1380601060108,"_hasShrinkwrap":false,"_cnpm_publish_time":1380601060108,"_cnpmcore_publish_time":"2021-12-16T22:24:26.991Z"},"1.1.0":{"name":"multibuffer","version":"1.1.0","description":"Package Arrays of Buffers into a single buffer that they can be later unpacked from.","main":"index.js","directories":{"test":"test"},"dependencies":{"bops":"0.1.0"},"devDependencies":{"tape":"~1.1.1"},"scripts":{"test":"node test/"},"keywords":["Buffers","Concat","pack","unpack","encode"],"author":{"name":"Bryce B. Baril"},"license":"MIT","repository":{"type":"git","url":"git://github.com/brycebaril/multibuffer.git"},"bugs":{"url":"https://github.com/brycebaril/multibuffer/issues"},"readmeFilename":"README.md","_id":"multibuffer@1.1.0","dist":{"shasum":"88b9b06f901965d3e689338b346b048e1441a66b","size":2298,"noattachment":false,"key":"/multibuffer/-/multibuffer-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/multibuffer/download/multibuffer-1.1.0.tgz"},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"bryce","email":"bryce@ravenwall.com"},"maintainers":[{"name":"bryce","email":""}],"publish_time":1380597443128,"_hasShrinkwrap":false,"_cnpm_publish_time":1380597443128,"_cnpmcore_publish_time":"2021-12-16T22:24:27.199Z"},"1.0.0":{"name":"multibuffer","version":"1.0.0","description":"Package Arrays of Buffers into a single buffer that they can be later unpacked from.","main":"index.js","directories":{"test":"test"},"dependencies":{"bops":"0.0.6"},"devDependencies":{"tape":"~1.1.1"},"scripts":{"test":"node test/"},"keywords":["Buffers","Concat","pack","unpack","encode"],"author":{"name":"Bryce B. Baril"},"license":"MIT","repository":{"type":"git","url":"git://github.com/brycebaril/multibuffer.git"},"bugs":{"url":"https://github.com/brycebaril/multibuffer/issues"},"readmeFilename":"README.md","_id":"multibuffer@1.0.0","dist":{"shasum":"4fd5f87df3b2b97866ce850735fdfdf46f343e91","size":2316,"noattachment":false,"key":"/multibuffer/-/multibuffer-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/multibuffer/download/multibuffer-1.0.0.tgz"},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"bryce","email":"bryce@ravenwall.com"},"maintainers":[{"name":"bryce","email":""}],"publish_time":1380401895139,"_hasShrinkwrap":false,"_cnpm_publish_time":1380401895139,"_cnpmcore_publish_time":"2021-12-16T22:24:27.394Z"}},"readme":"multibuffer\n=====\n\n[![NPM](https://nodei.co/npm/multibuffer.png)](https://nodei.co/npm/multibuffer/)\n\nPackage Arrays of Buffers into a single buffer that they can be later unpacked from.\n\nOne place this library can be useful is if you want to stream tuples of Buffer data without entering an objectMode stream.\n\nEach input buffer is prefixed with a [varint](https://npmjs.org/package/varint) prefix encoding how long the buffer is. The resulting buffer is the same length as all the concatenated buffers, plus a few bytes per buffer for the encodings.\n\nBecause encoding is at the beginning and varints can be consumed without back-tracking, this encoding is safe to nest upon itself.\n\n```javascript\nvar multibuffer = require(\"multibuffer\")\n\nvar input = [\n  new Buffer(\"Hi there\"),\n  new Buffer(\"BYE NOW!!!!!!!!!\")\n]\n\n/*\n[ <Buffer 48 69 20 74 68 65 72 65>,\n  <Buffer 42 59 45 20 4e 4f 57 21 21 21 21 21 21 21 21 21> ]\n */\n\nvar packed = multibuffer.pack(input)\n\n/*\n<Buffer 08 48 69 20 74 68 65 72 65 10 42 59 45 20 4e 4f 57 21 21 21 21 21 21 21 21 21>\n */\n\nvar unpacked = multibuffer.unpack(packed)\n/*\n[ <Buffer 48 69 20 74 68 65 72 65>,\n  <Buffer 42 59 45 20 4e 4f 57 21 21 21 21 21 21 21 21 21> ]\n */\n```\n\nAPI\n===\n\n`.pack(buffers, extra)`\n---\n\nPack the `Array[Buffer] buffers` into a single encoded Buffer. `extra` is an optional integer specifying how many leading empty bytes to leave in the returned Buffer.\n\n`.unpack(multibuffer)`\n---\n\nUnpack the `Array[Buffer] buffers` that were encoded into the multibuffer.\n\n`.encode(buffer, extra)`\n---\n\nEncode a single buffer. `extra` is an optional integer specifying how many leading empty bytes to leave in the returned Buffer.\n\n`.readPartial(multibuffer)`\n---\n\nAttempt to read the first encoded buffer from a multibuffer. Will return a two-element array of `[Buffer, Buffer]` which is `[firstBuffer, rest]`. If the multibuffer is incomplete, it will return `[null, multibuffer]` where the second element is the passed incomplete multibuffer.\n\nNOTES\n===\n\nThis library currently only supports packing buffers that are each a maximum of 4294967295 octets. My guess is you'll have memory issues before this is a bottleneck.\n\nLICENSE\n=======\n\nMIT\n","_attachments":{},"homepage":"https://github.com/brycebaril/multibuffer","bugs":{"url":"https://github.com/brycebaril/multibuffer/issues"},"license":"MIT"}