{"_id":"barse","_rev":"19-9dc32d68857846ffb918e40e4810ea53","name":"barse","description":"Binary parser with a fluent api","dist-tags":{"latest":"0.4.3"},"versions":{"0.0.0":{"name":"barse","description":"Binary parser with a fluent api","version":"0.0.0","repository":{"type":"git","url":"git://github.com/juliangruber/barse.git"},"homepage":"https://github.com/juliangruber/barse","main":"index.js","scripts":{"test":"tape test/*.js"},"dependencies":{"readable-stream":"~1.0.2"},"devDependencies":{"tape":"~1.0.1"},"keywords":["binary","parser","parse","fluent"],"author":{"name":"Julian Gruber","email":"mail@juliangruber.com","url":"http://juliangruber.com"},"license":"MIT","readme":"\n# barse\n\nBinary parser with a fluent API.\n\n## Usage\n\n```js\nvar parse = require('barse');\n\nvar parser = parse()\n  .next('foo', 3, function (chunk, offset) {\n    return chunk.toString('utf8', offset, offset + 3);\n  })\n  .next('bar', 3, function (chunk, offset) {\n    return chunk.toString('utf8', offset, offset + 3);\n  });\n\nparser.on('data', console.log);\n// => { foo : foo, bar : bar }\n\nparser.write(new Buffer('fo'));\nparser.write(new Buffer('ob'));\nparser.write(new Buffer('ar'));\n```\n\n## API\n\n### parse()\n\nCreate a new streaming parser.\n\n### parse#next(name, length, fn)\n\nConsume a chunk of binary data with the given `length`.\n\n`fn` is called with the current `chunk` and `offset` and is expected to synchronously return the parsed Object/String/whatever, which then will be emitted under `name` in the results object.\n\n## Installation\n\nWith [npm](http://npmjs.org) do\n\n```bash\n$ npm install barse\n```\n\n## License\n\nThe MIT License (MIT)\n\nCopyright (c) 2013 Julian Gruber &lt;julian@juliangruber.com&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.","readmeFilename":"README.md","_id":"barse@0.0.0","dist":{"shasum":"8a8ead217fe335e1fc980fe2a03862becfabefcb","tarball":"https://registry.npmjs.org/barse/-/barse-0.0.0.tgz","integrity":"sha512-SnYHleRbbbRWxhYin4ky1CAhyOkqGsijRTxCAfVmILdu/4lZ+dUgNi5GKxqjGp2OhOx7hcPIzfaIoyppVXZ6eQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFJpwvRazYrr036rSLMjeUktribwVkg9AAVE81i+p7F3AiEAqW/2gyIVhXcLv4iQX3vKKt+9mbZgdx2gPT/gWSPbXBM="}]},"_from":".","_npmVersion":"1.2.14","_npmUser":{"name":"juliangruber","email":"julian@juliangruber.com"},"maintainers":[{"name":"juliangruber","email":"julian@juliangruber.com"}]},"0.1.0":{"name":"barse","description":"Binary parser with a fluent api","version":"0.1.0","repository":{"type":"git","url":"git://github.com/juliangruber/barse.git"},"homepage":"https://github.com/juliangruber/barse","main":"index.js","scripts":{"test":"tape test/*.js"},"dependencies":{"readable-stream":"~1.0.2"},"devDependencies":{"tape":"~1.0.1"},"keywords":["binary","parser","parse","fluent"],"author":{"name":"Julian Gruber","email":"mail@juliangruber.com","url":"http://juliangruber.com"},"license":"MIT","readme":"\n# barse\n\nBinary parser with a fluent API.\n\n## Usage\n\n```js\nvar parse = require('barse');\n\nvar parser = parse()\n  .string('foo', 3)\n  .string('bar', 3)\n\nparser.on('data', console.log);\n// => { foo : foo, bar : bar }\n\nparser.write(new Buffer('fo'));\nparser.write(new Buffer('ob'));\nparser.write(new Buffer('ar'));\n```\n\n## API\n\n### parse()\n\nCreate a new streaming parser.\n\n### parse#string(name, length)\n### parse#buffer(name, length)\n### parse#read(U)Int{8,16,32}{BE,LE}(name)\n### parse#read{Float,Double}{BE,LE}(name)\n\nParse the given type with optional length and store in the results object under\n`name`.\n\n### parse#next(name, length, fn)\n\nConsume a chunk of binary data with the given `length`.\n\n`fn` is called with the current `chunk` and `offset` and is expected to synchronously return the parsed Object/String/whatever, which then will be emitted under `name` in the results object.\n\nThe example above written using `next`:\n\n```js\nparse()\n  .next('foo', 3, function (chunk, offset) {\n    return chunk.toString('utf8', offset, offset + 3);\n  })\n  .next('bar', 3, function (chunk, offset) {\n    return chunk.toString('utf8', offset, offset + 3);\n  })\n```\n\n## Installation\n\nWith [npm](http://npmjs.org) do\n\n```bash\n$ npm install barse\n```\n\n## License\n\nThe MIT License (MIT)\n\nCopyright (c) 2013 Julian Gruber &lt;julian@juliangruber.com&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n","readmeFilename":"README.md","_id":"barse@0.1.0","dist":{"shasum":"27c617042276b0d3294a3998157f6f6eeacacb48","tarball":"https://registry.npmjs.org/barse/-/barse-0.1.0.tgz","integrity":"sha512-+Sh11CHOhJtbvJzgp+n4R1SwRLwQRUivLxVUDP4KeibY/a/XjtW7AQhaK+GaM54ZPLf6ft377qBbw2h07riFXg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCJ9pDzTr+RAGR+o10d9bbcD/BqQA7G2sdNJdcSvO6ErAIhAInV0U587s8OREU0B2vsvx8UKktFxhNKyiWhF/NlrAYb"}]},"_from":".","_npmVersion":"1.2.14","_npmUser":{"name":"juliangruber","email":"julian@juliangruber.com"},"maintainers":[{"name":"juliangruber","email":"julian@juliangruber.com"}]},"0.2.0":{"name":"barse","description":"Binary parser with a fluent api","version":"0.2.0","repository":{"type":"git","url":"git://github.com/juliangruber/barse.git"},"homepage":"https://github.com/juliangruber/barse","main":"index.js","scripts":{"test":"tape test/*.js"},"dependencies":{"readable-stream":"~1.0.2"},"devDependencies":{"tape":"~1.0.1"},"keywords":["binary","parser","parse","fluent"],"author":{"name":"Julian Gruber","email":"mail@juliangruber.com","url":"http://juliangruber.com"},"license":"MIT","readme":"\n# barse\n\nBinary parser with a fluent API.\n\n## Usage\n\n```js\nvar parse = require('barse');\n\nvar parser = parse()\n  .string('foo', 3)\n  .string('bar', 3)\n\nparser.on('data', console.log);\n// => { foo : foo, bar : bar }\n\nparser.write(new Buffer('fo'));\nparser.write(new Buffer('ob'));\nparser.write(new Buffer('ar'));\n```\n\n## API\n\n### parse()\n\nCreate a new streaming parser.\n\n### parse#string(name, length[, encoding])\n### parse#buffer(name, length)\n### parse#read(U)Int{8,16,32}{BE,LE}(name)\n### parse#read{Float,Double}{BE,LE}(name)\n\nParse the given type with optional length and store in the results object under\n`name`.\n\n`length` can also be the name of a previously read field, e.g.:\n\n```js\nparse()\n  .readUInt8('length')\n  .string('content', 'length');\n```\n\n### parse#next(name, length, fn)\n\nConsume a chunk of binary data with the given `length`.\n\n`fn` is called with the current `chunk` and `offset` and is expected to synchronously return the parsed Object/String/whatever, which then will be emitted under `name` in the results object.\n\nThe example above written using `next`:\n\n```js\nparse()\n  .next('foo', 3, function (chunk, offset) {\n    return chunk.toString('utf8', offset, offset + 3);\n  })\n  .next('bar', 3, function (chunk, offset) {\n    return chunk.toString('utf8', offset, offset + 3);\n  })\n```\n\n## Installation\n\nWith [npm](http://npmjs.org) do\n\n```bash\n$ npm install barse\n```\n\n## License\n\nThe MIT License (MIT)\n\nCopyright (c) 2013 Julian Gruber &lt;julian@juliangruber.com&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n","readmeFilename":"README.md","_id":"barse@0.2.0","dist":{"shasum":"7cc06ce6eaa1858e290264e632f8e52458c6cc41","tarball":"https://registry.npmjs.org/barse/-/barse-0.2.0.tgz","integrity":"sha512-r17A+uM6WPhc7tdEOuXlCj5DZXPu7G0BqPpsyGu6XsF43rSiW0TdoP9/n2+vYwwGWbugWtkiyia0mMQf0IIeaQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCek755U3qygg5Yes6opFQYuAr7dYJuq/xMaS8uj6g/ogIgaZ3Us5B9O4B36d345R4MIZYyb7VqmEjEQeYujbrpbHo="}]},"_from":".","_npmVersion":"1.2.14","_npmUser":{"name":"juliangruber","email":"julian@juliangruber.com"},"maintainers":[{"name":"juliangruber","email":"julian@juliangruber.com"}]},"0.3.0":{"name":"barse","description":"Binary parser with a fluent api","version":"0.3.0","repository":{"type":"git","url":"git://github.com/juliangruber/barse.git"},"homepage":"https://github.com/juliangruber/barse","main":"index.js","scripts":{"test":"tape test/*.js"},"dependencies":{"readable-stream":"~1.0.2"},"devDependencies":{"tape":"~1.0.1"},"keywords":["binary","parser","parse","fluent"],"author":{"name":"Julian Gruber","email":"mail@juliangruber.com","url":"http://juliangruber.com"},"license":"MIT","readme":"\n# barse\n\nBinary parser with a fluent API.\n\n## Usage\n\n```js\nvar parse = require('..');\n\nvar parser = parse()\n  .readUInt8('string length')\n  .string('string', 'string length')\n  .readUInt8('field count')\n  .loop('fields', 2, function (loop) {\n    loop.readUInt8('some');\n    loop.readUInt8('numbers');\n  })\n\nparser.on('data', console.log);\n/*\n{\n  \"string length\" : 3,\n  \"string\" : \"foo\",\n  \"field count\" : 2,\n  \"fields\" : [\n    { \"some\" : 13, \"numbers\" : 37 },\n    { \"some\" : 73, \"numbers\" : 13 }\n  ]\n}\n*/\n\nvar buf = new Buffer(9);\nbuf.writeUInt8(3, 0); // string length\nbuf.write('foo', 1); // string\nbuf.writeUInt8(2, 4); // field count\nbuf.writeUInt8(13, 5); // fields[0].some\nbuf.writeUInt8(37, 6); // fields[0].numbers\nbuf.writeUInt8(73, 7); // fields[1].some\nbuf.writeUInt8(31, 8); // fields[1].numbers\n\nparser.write(buf);\n```\n\n## API\n\n### parse()\n\nCreate a new streaming parser.\n\n### parse#string(name, length[, encoding])\n### parse#buffer(name, length)\n### parse#read(U)Int{8,16,32}{BE,LE}(name)\n### parse#read{Float,Double}{BE,LE}(name)\n\nParse the given type with optional length and store in the results object under\n`name`.\n\n`length` can also be the name of a previously read field, e.g.:\n\n```js\nparse()\n  .readUInt8('length')\n  .string('content', 'length');\n```\n\n### parse#next(name, length, fn)\n\nConsume a chunk of binary data with the given `length`.\n\n`fn` is called with the current `chunk` and `offset` and is expected to synchronously return the parsed Object/String/whatever, which then will be emitted under `name` in the results object.\n\nThe example above written using `next`:\n\n```js\nparse()\n  .next('foo', 3, function (chunk, offset) {\n    return chunk.toString('utf8', offset, offset + 3);\n  })\n  .next('bar', 3, function (chunk, offset) {\n    return chunk.toString('utf8', offset, offset + 3);\n  })\n```\n\n### parse#loop(name, length, fn)\n\nRead `length` buffers and store under `name`.\n\n```js\nvar parser = parse()\n  .readUInt8('count')\n  .loop('strings', 'count', function (loop) {\n    loop.string('value', 3);\n  });\n\nparser.on('data', console.log);\n// => { strings : [{ value : 'foo' }, { value : 'bar' }]}\n\nvar count = new Buffer(1); count.writeUInt8(1, 0); parser.write(count);\nparser.write(new Buffer('foobar'));\n```\n\n## Installation\n\nWith [npm](http://npmjs.org) do\n\n```bash\n$ npm install barse\n```\n\n## License\n\nThe MIT License (MIT)\n\nCopyright (c) 2013 Julian Gruber &lt;julian@juliangruber.com&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n","readmeFilename":"README.md","_id":"barse@0.3.0","dist":{"shasum":"4fa7e667ec554464c3b68a555a71f3a04cde56f0","tarball":"https://registry.npmjs.org/barse/-/barse-0.3.0.tgz","integrity":"sha512-2TJKlTIUz3hQ2BF3t5s75w3xPc7VEHD9hJs3xA+Idw5Uca/psnDR8PujEeU2DH1ZRlUg9ECQl++P3XiT7Dn/UQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCAkcqYKvUVXQ0u03hzArRrPrYGihHKw5K3LZ6K+zySXgIgNDfZ5dpukE/fnTEulVjga7IrWjfM3GTOv72Bt7YoIq4="}]},"_from":".","_npmVersion":"1.2.14","_npmUser":{"name":"juliangruber","email":"julian@juliangruber.com"},"maintainers":[{"name":"juliangruber","email":"julian@juliangruber.com"}]},"0.4.0":{"name":"barse","description":"Binary parser with a fluent api","version":"0.4.0","repository":{"type":"git","url":"git://github.com/juliangruber/barse.git"},"homepage":"https://github.com/juliangruber/barse","main":"index.js","scripts":{"test":"tape test/*.js"},"dependencies":{"readable-stream":"~1.0.2"},"devDependencies":{"tape":"~1.0.1"},"keywords":["binary","parser","parse","fluent"],"author":{"name":"Julian Gruber","email":"mail@juliangruber.com","url":"http://juliangruber.com"},"license":"MIT","readme":"\n# barse\n\nBinary parser with a fluent API.\n\n## Usage\n\n```js\nvar parse = require('..');\n\nvar parser = parse()\n  .readUInt8('string length')\n  .string('string', 'string length')\n  .readUInt8('field count')\n  .loop('fields', 2, function (loop) {\n    loop.readUInt8('some');\n    loop.readUInt8('numbers');\n  })\n\nparser.on('data', console.log);\n/*\n{\n  \"string length\" : 3,\n  \"string\" : \"foo\",\n  \"field count\" : 2,\n  \"fields\" : [\n    { \"some\" : 13, \"numbers\" : 37 },\n    { \"some\" : 73, \"numbers\" : 31 }\n  ]\n}\n*/\n\nvar buf = new Buffer(9);\nbuf.writeUInt8(3, 0); // string length\nbuf.write('foo', 1); // string\nbuf.writeUInt8(2, 4); // field count\nbuf.writeUInt8(13, 5); // fields[0].some\nbuf.writeUInt8(37, 6); // fields[0].numbers\nbuf.writeUInt8(73, 7); // fields[1].some\nbuf.writeUInt8(31, 8); // fields[1].numbers\n\nparser.write(buf);\n```\n\n## API\n\n### parse()\n\nCreate a new streaming parser.\n\n### parse#string(name, length[, encoding])\n### parse#buffer(name, length)\n### parse#read(U)Int{8,16,32}{BE,LE}(name)\n### parse#read{Float,Double}{BE,LE}(name)\n\nParse the given type with optional length and store in the results object under\n`name`.\n\n`length` can also be the name of a previously read field, e.g.:\n\n```js\nparse()\n  .readUInt8('length')\n  .string('content', 'length');\n```\n\n### parse#next(name, length, fn)\n\nConsume a chunk of binary data with the given `length`.\n\n`fn` is called with the current `chunk` and `offset` and is expected to synchronously return the parsed Object/String/whatever, which then will be emitted under `name` in the results object.\nIn addition, `fn` is bound to the object containing the parsed data of the current chunk.\n\nThe example above written using `next`:\n\n```js\nparse()\n  .next('foo', 3, function (chunk, offset) {\n    return chunk.toString('utf8', offset, offset + 3);\n  })\n  .next('bar', 3, function (chunk, offset) {\n    return chunk.toString('utf8', offset, offset + 3);\n  })\n```\n\n### parse#loop(name, length, fn)\n\nRead `length` buffers and store under `name`.\n\n```js\nvar parser = parse()\n  .readUInt8('count')\n  .loop('strings', 'count', function (loop) {\n    loop.string('value', 3);\n  });\n\nparser.on('data', console.log);\n// => { strings : [{ value : 'foo' }, { value : 'bar' }]}\n\nvar count = new Buffer(1); count.writeUInt8(1, 0); parser.write(count);\nparser.write(new Buffer('foobar'));\n```\n\n## Installation\n\nWith [npm](http://npmjs.org) do\n\n```bash\n$ npm install barse\n```\n\n## License\n\nThe MIT License (MIT)\n\nCopyright (c) 2013 Julian Gruber &lt;julian@juliangruber.com&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n","readmeFilename":"README.md","_id":"barse@0.4.0","dist":{"shasum":"3fdfecbb5b43332f07b7ddc5a04c48345027e7ca","tarball":"https://registry.npmjs.org/barse/-/barse-0.4.0.tgz","integrity":"sha512-kJOu/w8gstNfev0QIKm0zdrE4LHR8/7wV/WkdqAuR4iTx1SsxPzBMhQLrxebXPw3JOVX2URfoHW48cRVSritSA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQChMRLRvVfM6V3hwvfKUBf2R/JIBoY1e0Ell9gYaZdXOAIgERKy9HU5GeTBHJAWk2Z4CaOHG/UD8t6cD/87CvXYja0="}]},"_from":".","_npmVersion":"1.2.14","_npmUser":{"name":"juliangruber","email":"julian@juliangruber.com"},"maintainers":[{"name":"juliangruber","email":"julian@juliangruber.com"}]},"0.4.1":{"name":"barse","description":"Binary parser with a fluent api","version":"0.4.1","repository":{"type":"git","url":"git://github.com/juliangruber/barse.git"},"homepage":"https://github.com/juliangruber/barse","main":"index.js","scripts":{"test":"tape test/*.js"},"dependencies":{"readable-stream":"~1.0.2"},"devDependencies":{"tape":"~1.0.1"},"keywords":["binary","parser","parse","fluent"],"author":{"name":"Julian Gruber","email":"mail@juliangruber.com","url":"http://juliangruber.com"},"license":"MIT","readme":"\n# barse\n\nBinary parser with a fluent API.\n\n## Usage\n\n```js\nvar parse = require('..');\n\nvar parser = parse()\n  .readUInt8('string length')\n  .string('string', 'string length')\n  .readUInt8('field count')\n  .loop('fields', 2, function (loop) {\n    loop.readUInt8('some');\n    loop.readUInt8('numbers');\n  })\n\nparser.on('data', console.log);\n/*\n{\n  \"string length\" : 3,\n  \"string\" : \"foo\",\n  \"field count\" : 2,\n  \"fields\" : [\n    { \"some\" : 13, \"numbers\" : 37 },\n    { \"some\" : 73, \"numbers\" : 31 }\n  ]\n}\n*/\n\nvar buf = new Buffer(9);\nbuf.writeUInt8(3, 0); // string length\nbuf.write('foo', 1); // string\nbuf.writeUInt8(2, 4); // field count\nbuf.writeUInt8(13, 5); // fields[0].some\nbuf.writeUInt8(37, 6); // fields[0].numbers\nbuf.writeUInt8(73, 7); // fields[1].some\nbuf.writeUInt8(31, 8); // fields[1].numbers\n\nparser.write(buf);\n```\n\n## API\n\n### parse()\n\nCreate a new streaming parser.\n\n### parse#string(name, length[, encoding])\n### parse#buffer(name, length)\n### parse#read(U)Int{8,16,32}{BE,LE}(name)\n### parse#read{Float,Double}{BE,LE}(name)\n\nParse the given type with optional length and store in the results object under\n`name`.\n\n`length` can also be the name of a previously read field, e.g.:\n\n```js\nparse()\n  .readUInt8('length')\n  .string('content', 'length');\n```\n\n### parse#next(name, length, fn)\n\nConsume a chunk of binary data with the given `length`.\n\n`fn` is called with the current `chunk` and `offset` and is expected to synchronously return the parsed Object/String/whatever, which then will be emitted under `name` in the results object.\nIn addition, `fn` is bound to the object containing the parsed data of the current chunk.\n\nThe example above written using `next`:\n\n```js\nparse()\n  .next('foo', 3, function (chunk, offset) {\n    return chunk.toString('utf8', offset, offset + 3);\n  })\n  .next('bar', 3, function (chunk, offset) {\n    return chunk.toString('utf8', offset, offset + 3);\n  })\n```\n\n### parse#loop(name, length, fn)\n\nRead `length` buffers and store under `name`.\n\n```js\nvar parser = parse()\n  .readUInt8('count')\n  .loop('strings', 'count', function (loop) {\n    loop.string('value', 3);\n  });\n\nparser.on('data', console.log);\n// => { strings : [{ value : 'foo' }, { value : 'bar' }]}\n\nvar count = new Buffer(1); count.writeUInt8(1, 0); parser.write(count);\nparser.write(new Buffer('foobar'));\n```\n\n## Installation\n\nWith [npm](http://npmjs.org) do\n\n```bash\n$ npm install barse\n```\n\n## License\n\nThe MIT License (MIT)\n\nCopyright (c) 2013 Julian Gruber &lt;julian@juliangruber.com&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n","readmeFilename":"README.md","_id":"barse@0.4.1","dist":{"shasum":"61b636d261e3c0a27f8a542b7d046018b51df3dd","tarball":"https://registry.npmjs.org/barse/-/barse-0.4.1.tgz","integrity":"sha512-WlJLyOdNsm8uLjLlbNvNTT0MZeHDETR9Uwx2kNBFGcUpm/x/sKewzS7y5fJV05g9BWtqG36i8i2YJ5/6o3Hu8w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGHKHYyL09WFVONcplde0x/4KEp8aiJfLPCE9LLx7pTbAiAXP4NMooOEXjSPEZJdhfbytuhPORxTiOkzj7yYA8EWxw=="}]},"_from":".","_npmVersion":"1.2.14","_npmUser":{"name":"juliangruber","email":"julian@juliangruber.com"},"maintainers":[{"name":"juliangruber","email":"julian@juliangruber.com"}]},"0.4.2":{"name":"barse","description":"Binary parser with a fluent api","version":"0.4.2","repository":{"type":"git","url":"git://github.com/juliangruber/barse.git"},"homepage":"https://github.com/juliangruber/barse","main":"index.js","scripts":{"test":"tape test/*.js"},"dependencies":{"readable-stream":"~1.0.2"},"devDependencies":{"tape":"~1.0.1"},"keywords":["binary","parser","parse","fluent"],"author":{"name":"Julian Gruber","email":"mail@juliangruber.com","url":"http://juliangruber.com"},"license":"MIT","testling":{"files":"test/*.js","browsers":["ie/8..latest","firefox/17..latest","firefox/nightly","chrome/22..latest","chrome/canary","opera/12..latest","opera/next","safari/5.1..latest","ipad/6.0..latest","iphone/6.0..latest","android-browser/4.2..latest"]},"readme":"\n# barse\n\nBinary parser with a fluent API.\n\n[![build status](https://secure.travis-ci.org/juliangruber/barse.png)](http://travis-ci.org/juliangruber/barse)\n\n[![testling badge](https://ci.testling.com/juliangruber/barse.png)](https://ci.testling.com/juliangruber/barse)\n\n## Usage\n\n```js\nvar parse = require('..');\n\nvar parser = parse()\n  .readUInt8('string length')\n  .string('string', 'string length')\n  .readUInt8('field count')\n  .loop('fields', 2, function (loop) {\n    loop.readUInt8('some');\n    loop.readUInt8('numbers');\n  })\n\nparser.on('data', console.log);\n/*\n{\n  \"string length\" : 3,\n  \"string\" : \"foo\",\n  \"field count\" : 2,\n  \"fields\" : [\n    { \"some\" : 13, \"numbers\" : 37 },\n    { \"some\" : 73, \"numbers\" : 31 }\n  ]\n}\n*/\n\nvar buf = new Buffer(9);\nbuf.writeUInt8(3, 0); // string length\nbuf.write('foo', 1); // string\nbuf.writeUInt8(2, 4); // field count\nbuf.writeUInt8(13, 5); // fields[0].some\nbuf.writeUInt8(37, 6); // fields[0].numbers\nbuf.writeUInt8(73, 7); // fields[1].some\nbuf.writeUInt8(31, 8); // fields[1].numbers\n\nparser.write(buf);\n```\n\n## API\n\n### parse()\n\nCreate a new streaming parser.\n\n### parse#string(name, length[, encoding])\n### parse#buffer(name, length)\n### parse#read(U)Int{8,16,32}{BE,LE}(name)\n### parse#read{Float,Double}{BE,LE}(name)\n\nParse the given type with optional length and store in the results object under\n`name`.\n\n`length` can also be the name of a previously read field, e.g.:\n\n```js\nparse()\n  .readUInt8('length')\n  .string('content', 'length');\n```\n\n### parse#next(name, length, fn)\n\nConsume a chunk of binary data with the given `length`.\n\n`fn` is called with the current `chunk` and `offset` and is expected to synchronously return the parsed Object/String/whatever, which then will be emitted under `name` in the results object.\nIn addition, `fn` is bound to the object containing the parsed data of the current chunk.\n\nThe example above written using `next`:\n\n```js\nparse()\n  .next('foo', 3, function (chunk, offset) {\n    return chunk.toString('utf8', offset, offset + 3);\n  })\n  .next('bar', 3, function (chunk, offset) {\n    return chunk.toString('utf8', offset, offset + 3);\n  })\n```\n\n### parse#loop(name, length, fn)\n\nRead `length` buffers and store under `name`.\n\n```js\nvar parser = parse()\n  .readUInt8('count')\n  .loop('strings', 'count', function (loop) {\n    loop.string('value', 3);\n  });\n\nparser.on('data', console.log);\n// => { strings : [{ value : 'foo' }, { value : 'bar' }]}\n\nvar count = new Buffer(1); count.writeUInt8(1, 0); parser.write(count);\nparser.write(new Buffer('foobar'));\n```\n\n## Installation\n\nWith [npm](http://npmjs.org) do\n\n```bash\n$ npm install barse\n```\n\n## License\n\nThe MIT License (MIT)\n\nCopyright (c) 2013 Julian Gruber &lt;julian@juliangruber.com&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/juliangruber/barse/issues"},"_id":"barse@0.4.2","dist":{"shasum":"a4502bf5c84f05dd7c335aa14e900a68810b974d","tarball":"https://registry.npmjs.org/barse/-/barse-0.4.2.tgz","integrity":"sha512-wluEnSLpktPyiR3lYJXMprRelg1BBmUBq1ofmJSnr2TpkKqJ9VxkdnIbdtfeJ9pZiYNC249GwJGJKNr57F+dbQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDpa+VMaeXbchkP/Laf05uniOdZZHWtuw4OSPB6p6yJvgIgHLy/KKw7iAbQbwT3VarDSzLC5+F/XM0zvO6zNAoKyfQ="}]},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"juliangruber","email":"julian@juliangruber.com"},"maintainers":[{"name":"juliangruber","email":"julian@juliangruber.com"}]},"0.4.3":{"name":"barse","description":"Binary parser with a fluent api","version":"0.4.3","repository":{"type":"git","url":"git://github.com/juliangruber/barse.git"},"homepage":"https://github.com/juliangruber/barse","main":"index.js","scripts":{"test":"tape test/*.js"},"dependencies":{"readable-stream":"~1.0.2"},"devDependencies":{"tape":"~2.3.2"},"keywords":["binary","parser","parse","fluent"],"author":{"name":"Julian Gruber","email":"mail@juliangruber.com","url":"http://juliangruber.com"},"license":"MIT","testling":{"files":"test/*.js","browsers":["ie/8..latest","firefox/17..latest","firefox/nightly","chrome/22..latest","chrome/canary","opera/12..latest","opera/next","safari/5.1..latest","ipad/6.0..latest","iphone/6.0..latest","android-browser/4.2..latest"]},"readme":"\n# barse\n\nBinary parser with a fluent API.\n\n[![build status](https://secure.travis-ci.org/juliangruber/barse.png)](http://travis-ci.org/juliangruber/barse)\n\n[![testling badge](https://ci.testling.com/juliangruber/barse.png)](https://ci.testling.com/juliangruber/barse)\n\n## Usage\n\n```js\nvar parse = require('..');\n\nvar parser = parse()\n  .readUInt8('string length')\n  .string('string', 'string length')\n  .readUInt8('field count')\n  .loop('fields', 2, function (loop) {\n    loop.readUInt8('some');\n    loop.readUInt8('numbers');\n  })\n\nparser.on('data', console.log);\n/*\n{\n  \"string length\" : 3,\n  \"string\" : \"foo\",\n  \"field count\" : 2,\n  \"fields\" : [\n    { \"some\" : 13, \"numbers\" : 37 },\n    { \"some\" : 73, \"numbers\" : 31 }\n  ]\n}\n*/\n\nvar buf = new Buffer(9);\nbuf.writeUInt8(3, 0); // string length\nbuf.write('foo', 1); // string\nbuf.writeUInt8(2, 4); // field count\nbuf.writeUInt8(13, 5); // fields[0].some\nbuf.writeUInt8(37, 6); // fields[0].numbers\nbuf.writeUInt8(73, 7); // fields[1].some\nbuf.writeUInt8(31, 8); // fields[1].numbers\n\nparser.write(buf);\n```\n\n## API\n\n### parse()\n\nCreate a new streaming parser.\n\n### parse#string(name, length[, encoding])\n### parse#buffer(name, length)\n### parse#read(U)Int{8,16,32}{BE,LE}(name)\n### parse#read{Float,Double}{BE,LE}(name)\n\nParse the given type with optional length and store in the results object under\n`name`.\n\n`length` can also be the name of a previously read field, e.g.:\n\n```js\nparse()\n  .readUInt8('length')\n  .string('content', 'length');\n```\n\n### parse#next(name, length, fn)\n\nConsume a chunk of binary data with the given `length`.\n\n`fn` is called with the current `chunk` and `offset` and is expected to synchronously return the parsed Object/String/whatever, which then will be emitted under `name` in the results object.\nIn addition, `fn` is bound to the object containing the parsed data of the current chunk.\n\nThe example above written using `next`:\n\n```js\nparse()\n  .next('foo', 3, function (chunk, offset) {\n    return chunk.toString('utf8', offset, offset + 3);\n  })\n  .next('bar', 3, function (chunk, offset) {\n    return chunk.toString('utf8', offset, offset + 3);\n  })\n```\n\n### parse#loop(name, length, fn)\n\nRead `length` buffers and store under `name`.\n\n```js\nvar parser = parse()\n  .readUInt8('count')\n  .loop('strings', 'count', function (loop) {\n    loop.string('value', 3);\n  });\n\nparser.on('data', console.log);\n// => { strings : [{ value : 'foo' }, { value : 'bar' }]}\n\nvar count = new Buffer(1); count.writeUInt8(1, 0); parser.write(count);\nparser.write(new Buffer('foobar'));\n```\n\n## Installation\n\nWith [npm](http://npmjs.org) do\n\n```bash\n$ npm install barse\n```\n\n## License\n\nThe MIT License (MIT)\n\nCopyright (c) 2013 Julian Gruber &lt;julian@juliangruber.com&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/juliangruber/barse/issues"},"_id":"barse@0.4.3","dist":{"shasum":"289864d795d0102bbbb181e66ecd08c54a1bc0cb","tarball":"https://registry.npmjs.org/barse/-/barse-0.4.3.tgz","integrity":"sha512-UEpvriJqAn8zuVinYICuKoPttZy3XxXEoqX/V2uYAL4zzJRuNzCK3+20nAu3YUIa2U7G53kf90wfBIp9/A+Odw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIANpRy4eX3G0/OghnwiRqttr00ZxxF4gldNsWWEPqt/NAiEAjmDK4pC6fO/tyYhzE5rwmPFavr2YrTjZt9LwvjPYF2Y="}]},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"juliangruber","email":"julian@juliangruber.com"},"maintainers":[{"name":"juliangruber","email":"julian@juliangruber.com"}]}},"readme":"\n# barse\n\nBinary parser with a fluent API.\n\n## Usage\n\n```js\nvar parse = require('barse');\n\nvar parser = parse()\n  .next('foo', 3, function (chunk, offset) {\n    return chunk.toString('utf8', offset, offset + 3);\n  })\n  .next('bar', 3, function (chunk, offset) {\n    return chunk.toString('utf8', offset, offset + 3);\n  });\n\nparser.on('data', console.log);\n// => { foo : foo, bar : bar }\n\nparser.write(new Buffer('fo'));\nparser.write(new Buffer('ob'));\nparser.write(new Buffer('ar'));\n```\n\n## API\n\n### parse()\n\nCreate a new streaming parser.\n\n### parse#next(name, length, fn)\n\nConsume a chunk of binary data with the given `length`.\n\n`fn` is called with the current `chunk` and `offset` and is expected to synchronously return the parsed Object/String/whatever, which then will be emitted under `name` in the results object.\n\n## Installation\n\nWith [npm](http://npmjs.org) do\n\n```bash\n$ npm install barse\n```\n\n## License\n\nThe MIT License (MIT)\n\nCopyright (c) 2013 Julian Gruber &lt;julian@juliangruber.com&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.","maintainers":[{"name":"juliangruber","email":"julian@juliangruber.com"}],"time":{"modified":"2022-06-13T04:16:24.238Z","created":"2013-05-05T10:56:12.719Z","0.0.0":"2013-05-05T10:56:15.718Z","0.1.0":"2013-05-05T11:11:54.589Z","0.2.0":"2013-05-05T11:23:52.813Z","0.3.0":"2013-05-05T12:09:51.760Z","0.4.0":"2013-05-05T12:20:21.938Z","0.4.1":"2013-05-05T12:38:50.617Z","0.4.2":"2013-12-30T09:46:40.376Z","0.4.3":"2013-12-31T07:15:28.936Z"},"author":{"name":"Julian Gruber","email":"mail@juliangruber.com","url":"http://juliangruber.com"},"repository":{"type":"git","url":"git://github.com/juliangruber/barse.git"}}