{"_id":"binary-data","_rev":"9-0e61d47a898c90c95fc2ab196f823e17","name":"binary-data","description":"Declarative binary data encoder / decoder.","dist-tags":{"latest":"0.6.0","next":"0.5.0-0"},"versions":{"0.1.0":{"name":"binary-data","version":"0.1.0","description":"Declarative encoder/decoder of various binary data.","main":"index.js","scripts":{"test":"npm run lint && jest","cover":"jest --coverage","lint":"eslint *.js"},"repository":{"type":"git","url":"git+https://github.com/reklatsmasters/binary-data.git"},"keywords":["binary","data","buffer","stream","decode","encode","bl","bin-protocol","restructure"],"author":{"name":"Dmitry Tsvettsikh","email":"me@reklatsmasters.com"},"license":"MIT","bugs":{"url":"https://github.com/reklatsmasters/binary-data/issues"},"homepage":"https://github.com/reklatsmasters/binary-data#readme","engines":{"node":">=6"},"dependencies":{"bl":"^1.2.1","is-plain-object":"^2.0.3"},"devDependencies":{"eslint":"^4.1.1","eslint-plugin-prettier":"^2.1.2","jest":"^20.0.4","prettier":"^1.5.2","sinon":"^2.3.6"},"jest":{"modulePaths":["<rootDir>"],"testRegex":"test/(.*)\\.js$","coverageDirectory":"<rootDir>/coverage","coveragePathIgnorePatterns":["/test/","/testing/"]},"gitHead":"b462be1d6b50d1b06f72c01e6d01ac39de6d47eb","_id":"binary-data@0.1.0","_npmVersion":"5.3.0","_nodeVersion":"8.1.2","_npmUser":{"name":"reklatsmasters","email":"me@reklatsmasters.com"},"dist":{"integrity":"sha512-zHI0RJyjYKnHVuYq4989SKDg8MKb+x/ZtzNK0dKPKJf5RScjpmywGDiDLXy3o2wkGbCtEYe6IkfVv/C86zBigg==","shasum":"efcc8c0791f8a9289b331f9f5302495a831ac49f","tarball":"https://registry.npmjs.org/binary-data/-/binary-data-0.1.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD3nx2e8TKWd2fL8I3NTD4aJk1UpMKmuFo08Mm9YW8RHwIgKnH/+/g4JaDBuxBqzqBa2Quh6h23VonTL3HNvcgTjWs="}]},"maintainers":[{"name":"reklatsmasters","email":"me@reklatsmasters.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/binary-data-0.1.0.tgz_1500918062016_0.4198124634567648"},"directories":{}},"0.2.0":{"name":"binary-data","version":"0.2.0","description":"Declarative encoder/decoder of various binary data.","main":"index.js","scripts":{"lint":"xo","cover":"jest --coverage","test":"npm run lint && jest","test-ci":"npm run lint && npm run cover"},"repository":{"type":"git","url":"git+https://github.com/reklatsmasters/binary-data.git"},"keywords":["binary","data","buffer","stream","decode","encode","bl","bin-protocol","restructure"],"author":{"name":"Dmitry Tsvettsikh","email":"me@reklatsmasters.com"},"license":"MIT","bugs":{"url":"https://github.com/reklatsmasters/binary-data/issues"},"homepage":"https://github.com/reklatsmasters/binary-data#readme","engines":{"node":">=6"},"dependencies":{"bl":"^1.2.1","is-plain-object":"^2.0.3"},"devDependencies":{"jest":"^20.0.4","sinon":"^4.1.3","xo":"^0.18.2"},"jest":{"modulePaths":["<rootDir>"],"testRegex":"test/(.*)\\.js$","coverageDirectory":"<rootDir>/coverage","coveragePathIgnorePatterns":["/test/","/testing/"]},"xo":{"semicolon":false,"space":2,"rules":{"object-curly-spacing":["error","always"]},"ignores":["**/test/**"]},"gitHead":"b9919163edc4688ecde7cccde71a3b03d87c4df7","_id":"binary-data@0.2.0","_npmVersion":"5.6.0","_nodeVersion":"9.3.0","_npmUser":{"name":"reklatsmasters","email":"me@reklatsmasters.com"},"dist":{"integrity":"sha512-pIjSOdvb8hhtQFNlOQJb2afDkNM2wGDq5VHPmfP+MhNr0325t4Mo3a5oOtSSCrDEP5ZB0Oul1yXBu5yRrNxyvA==","shasum":"d84dd491987383a1aff5127019129df94f4230a1","tarball":"https://registry.npmjs.org/binary-data/-/binary-data-0.2.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEZN+QxvtZj2CjnfWm8/wZBiNndEb8UTlY9OGyWBqY7aAiEAraiEZmJvCOh6uunXHKbCS0mV6uP+DRFodgQcyqDohrs="}]},"maintainers":[{"name":"reklatsmasters","email":"me@reklatsmasters.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/binary-data-0.2.0.tgz_1516576430221_0.12786377081647515"},"directories":{}},"0.2.1":{"name":"binary-data","version":"0.2.1","description":"Declarative encoder/decoder of various binary data.","main":"index.js","scripts":{"lint":"xo","cover":"jest --coverage","test":"npm run lint && jest","test-ci":"npm run lint && npm run cover"},"repository":{"type":"git","url":"git+https://github.com/reklatsmasters/binary-data.git"},"keywords":["binary","data","buffer","stream","decode","encode","bl","bin-protocol","restructure"],"author":{"name":"Dmitry Tsvettsikh","email":"me@reklatsmasters.com"},"license":"MIT","bugs":{"url":"https://github.com/reklatsmasters/binary-data/issues"},"homepage":"https://github.com/reklatsmasters/binary-data#readme","engines":{"node":">=6"},"dependencies":{"bl":"^1.2.1","is-plain-object":"^2.0.3"},"devDependencies":{"jest":"^20.0.4","sinon":"^4.1.3","xo":"^0.18.2"},"jest":{"modulePaths":["<rootDir>"],"testRegex":"test/(.*)\\.js$","coverageDirectory":"<rootDir>/coverage","coveragePathIgnorePatterns":["/test/","/testing/"]},"xo":{"semicolon":false,"space":2,"rules":{"object-curly-spacing":["error","always"]},"ignores":["**/test/**"]},"gitHead":"342cf2440159509e8c0d1f65edf12249a38dc015","_id":"binary-data@0.2.1","_npmVersion":"5.6.0","_nodeVersion":"9.3.0","_npmUser":{"name":"reklatsmasters","email":"me@reklatsmasters.com"},"dist":{"integrity":"sha512-9X/frXi5g/u2skwVHkq5ZMLhQbV6bCmyeInhzyK67jrDa/KdHSTYpTFgW4gC1PQca8Hf1SLjyCNhn3baIC8Wyw==","shasum":"c80d6f84e4c7773fdd613c40cd5bd94326e15b8c","tarball":"https://registry.npmjs.org/binary-data/-/binary-data-0.2.1.tgz","fileCount":35,"unpackedSize":79381,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDhz2AzuY75D0a02+Y3gz1ouEtRoO0dWwp117R1pyXLOQIhANeZdeJrIhJtbd0lTNIY5ZXNfzLsLCiwxsB3bLAIZWiv"}]},"maintainers":[{"name":"reklatsmasters","email":"me@reklatsmasters.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/binary-data_0.2.1_1519412621574_0.12903371187569546"},"_hasShrinkwrap":false},"0.3.0":{"name":"binary-data","version":"0.3.0","description":"Declarative encoder/decoder of various binary data.","main":"src/index.js","scripts":{"lint":"xo","cover":"jest --coverage","test":"npm run lint && jest","test-ci":"npm run lint && npm run cover"},"repository":{"type":"git","url":"git+https://github.com/reklatsmasters/binary-data.git"},"keywords":["binary","data","buffer","stream","decode","encode","bl","bin-protocol","restructure"],"author":{"name":"Dmitry Tsvettsikh","email":"me@reklatsmasters.com"},"license":"MIT","bugs":{"url":"https://github.com/reklatsmasters/binary-data/issues"},"homepage":"https://github.com/reklatsmasters/binary-data#readme","engines":{"node":">=6"},"dependencies":{"bl":"^1.2.1","is-plain-object":"^2.0.3"},"devDependencies":{"jest":"^20.0.4","sinon":"^4.4.2","xo":"^0.18.2"},"jest":{"modulePaths":["<rootDir>","<rootDir>/src","<rootDir>/src/node_modules"],"testRegex":"test/(.*)\\.js$","coverageDirectory":"<rootDir>/coverage","coveragePathIgnorePatterns":["/test/","/testing/"]},"xo":{"semicolon":false,"space":2,"rules":{"object-curly-spacing":["error","always"],"import/no-extraneous-dependencies":"off"},"ignores":["**/test/**","!src/node_modules/**"]},"gitHead":"356231cea6e19f00f7e3acf7c5d15ea37dce56ae","_id":"binary-data@0.3.0","_npmVersion":"5.6.0","_nodeVersion":"9.7.1","_npmUser":{"name":"reklatsmasters","email":"me@reklatsmasters.com"},"dist":{"integrity":"sha512-88kIprjxK3a11TCncY71boxcQwyk99Ff5qJ/Qcw1yAqKAe7v18ZqhqMQgBjHFFuSYWMf40Nlwe0PPdrQnZSTZA==","shasum":"9f14e2d7dc1c88ffef6f7b81783036388c4a2387","tarball":"https://registry.npmjs.org/binary-data/-/binary-data-0.3.0.tgz","fileCount":38,"unpackedSize":95814,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDruVq1lCBnZMlq2kCOaskvayo9Bj47C1AuGeYD4NLYvAIgQng3ictX2g+AaongFrmRsM2i84PVH//KA/pf5PArF+k="}]},"maintainers":[{"name":"reklatsmasters","email":"me@reklatsmasters.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/binary-data_0.3.0_1520593752376_0.5558338705310593"},"_hasShrinkwrap":false},"0.4.0":{"name":"binary-data","version":"0.4.0","description":"Declarative encoder/decoder of various binary data.","main":"src/index.js","scripts":{"lint":"eslint .","cover":"jest --coverage","test":"npm run lint && jest","test-ci":"npm run lint && npm run cover"},"repository":{"type":"git","url":"git+https://github.com/reklatsmasters/binary-data.git"},"keywords":["binary","data","buffer","stream","decode","encode","bl","bin-protocol","restructure"],"author":{"name":"Dmitry Tsvettsikh","email":"me@reklatsmasters.com"},"license":"MIT","bugs":{"url":"https://github.com/reklatsmasters/binary-data/issues"},"homepage":"https://github.com/reklatsmasters/binary-data#readme","engines":{"node":">=6"},"dependencies":{"bl":"^1.2.1","is-plain-object":"^2.0.3"},"devDependencies":{"eslint":"^4.19.1","eslint-config-prettier":"^2.9.0","eslint-config-xo-space":"^0.18.0","eslint-plugin-import":"^2.9.0","eslint-plugin-no-use-extend-native":"^0.3.12","eslint-plugin-node":"^6.0.1","eslint-plugin-prettier":"^2.6.0","eslint-plugin-promise":"^3.7.0","eslint-plugin-unicorn":"^4.0.2","jest":"^22.4.3","prettier":"^1.11.1"},"jest":{"modulePaths":["<rootDir>","<rootDir>/src","<rootDir>/src/node_modules"],"testRegex":"test/(.*)\\.js$","coverageDirectory":"<rootDir>/coverage","coveragePathIgnorePatterns":["<rootDir>/node_modules/"],"collectCoverageFrom":["src/**/*.js"]},"gitHead":"3407958b47cc765ecd0eebf5f42229d164bb9f39","_id":"binary-data@0.4.0","_npmVersion":"5.6.0","_nodeVersion":"9.9.0","_npmUser":{"name":"reklatsmasters","email":"me@reklatsmasters.com"},"dist":{"integrity":"sha512-o9qkSg2FW3v4Y51AH3xaM97/gdTBtcSTzaWsTGWAuGTyb1nYNF/Q6zGaIp4VVGOD9P/5WK3h8e5N25A35whrIA==","shasum":"02449f789c5006bf459746eaa8b1d865f0414ff9","tarball":"https://registry.npmjs.org/binary-data/-/binary-data-0.4.0.tgz","fileCount":44,"unpackedSize":47495,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa6A0VCRA9TVsSAnZWagAAtY4P/i6CpMtwsAdt50J5B6+Y\nQkOqNZa4cxF5YcyFu2JU8IIz67+0ZfV1kGePRcrydFYA4U0XJXxY3I4G8HS7\n3dDg200dloMLBT0Mq2E6BVl92djb387dkF0aBe2UuM1+5en52MgkeLvt7rgF\nU94X2l4TbImmUgJS/xq7WLvq5w8Cvn8ohLJ5C0O8Y9V8fz5sGJOQSxenTDfs\ncQVTg4LCTPWbRtD2mtw59EBtX7S4wjP3cguMHITcjrVV52gR1cPCAEsAId1M\n4yh0ANMFmgQI4JgQk5sCel5uOYaC+uAyltPyVIIy905bdoPW+mjtIUsQWbnp\nFeW+9D+3e7oTUVpMZDVWzd/ic0EW9JwmcrUbfe7y3RSetEoLYnI44OC+LZ/n\n/drT7Ko1nfKLfhykDn+oy6Nu6mfC5u9qid/YPpmam/xi7nylaICG4b49mN8C\nH23ZR0vavQ4ByPKo+hGEV2ZbVHhw6VcVqby60vH2DkDc39yB5YfRSIm3JR4e\neeLZI9LGrCDWvawja/GIPN+7V7JCAXx56+zB3IRMRaDHg+HU3bdyiEM/9xp9\nmPUFz27w/F5VGpP+e70XYqOi3AY74K95dPL0AsaHfPBRq0F7pngIaJcEmPXK\nOf1YBWGi/9N4/O4vzghdFM6PCPPH66bwKEDop8C9t+UY/jHUGNZqbYb3jOTG\nOwxf\r\n=8mfB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDSe7oI0+YCYYDu9JyxFqKgUe06cvY76vbzBUzINDmMcwIhAIxfYaFtannVEcdh9B4YCsNbBUy5vOGo0/WgAW/M8oqf"}]},"maintainers":[{"name":"reklatsmasters","email":"me@reklatsmasters.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/binary-data_0.4.0_1525157139872_0.13215484208974249"},"_hasShrinkwrap":false},"0.5.0-0":{"name":"binary-data","version":"0.5.0-0","description":"Declarative encoder/decoder of various binary data.","main":"src/index.js","scripts":{"lint":"eslint .","cover":"jest --coverage","test":"npm run lint && jest","test-ci":"npm run lint && npm run cover"},"repository":{"type":"git","url":"git+https://github.com/reklatsmasters/binary-data.git"},"keywords":["binary","data","buffer","stream","decode","encode","bl","bin-protocol","restructure"],"author":{"name":"Dmitry Tsvettsikh","email":"me@reklatsmasters.com"},"license":"MIT","bugs":{"url":"https://github.com/reklatsmasters/binary-data/issues"},"homepage":"https://github.com/reklatsmasters/binary-data#readme","engines":{"node":">=6"},"dependencies":{"bl":"^2.0.0","is-plain-object":"^2.0.3"},"devDependencies":{"eslint":"^4.19.1","eslint-config-prettier":"^2.9.0","eslint-config-xo-space":"^0.18.0","eslint-plugin-import":"^2.9.0","eslint-plugin-no-use-extend-native":"^0.3.12","eslint-plugin-node":"^6.0.1","eslint-plugin-prettier":"^2.6.0","eslint-plugin-promise":"^3.7.0","eslint-plugin-unicorn":"^4.0.2","jest":"^22.4.3","prettier":"^1.11.1"},"jest":{"modulePaths":["<rootDir>","<rootDir>/src","<rootDir>/src/node_modules"],"testRegex":"test/(.*)\\.js$","coverageDirectory":"<rootDir>/coverage","coveragePathIgnorePatterns":["<rootDir>/node_modules/"],"collectCoverageFrom":["src/**/*.js"]},"readme":"# binary-data\n\n[![Build Status](https://travis-ci.org/reklatsmasters/binary-data.svg?branch=master)](https://travis-ci.org/reklatsmasters/binary-data)\n[![npm](https://img.shields.io/npm/v/binary-data.svg)](https://npmjs.org/package/binary-data)\n[![node](https://img.shields.io/node/v/binary-data.svg)](https://npmjs.org/package/binary-data)\n[![license](https://img.shields.io/npm/l/binary-data.svg)](https://npmjs.org/package/binary-data)\n[![downloads](https://img.shields.io/npm/dm/binary-data.svg)](https://npmjs.org/package/binary-data)\n[![Greenkeeper badge](https://badges.greenkeeper.io/reklatsmasters/binary-data.svg)](https://greenkeeper.io/)\n\nDeclarative encoder/decoder of various binary data. This module works almost like as [`binary`](https://www.npmjs.com/package/binary) or [`restructure`](https://www.npmjs.com/package/restructure) but provided modern and clean api.\n\n## Usage\n\n#### decode\n\n```js\nconst { decode, createDecodeStream, types: { uint8, array, string } } = require('binary-data')\n\n// 1.1 define your own schema as plain object\nconst protocol = {\n  type: uint8,\n  value: array(string(null), uint8)\n}\n\nsocket.on('message', (message) => {\n  // 1.2 decode message\n  const packet = decode(message, protocol)\n})\n\n// 2.1 also you may decode messages from streams\nconst unicast = require('unicast')\n\nconst socket = unicast.createSocket({ /* options */ })\n\n// 2.2 create stream\nconst input = createDecodeStream(protocol)\n\n// 2.3 connect streams\nsocket.pipe(input).on('data', packet => { /* do stuff */ })\n```\n\n#### encode\n\n```js\nconst { encode, createEncodeStream, types: { uint8, buffer } } = require('binary-data')\n\n// 1. define schema\nconst protocol = {\n  type: uint8,\n  data: buffer(uint8)\n}\n\n// 2. create data object (string, array - what you want)\nconst hello = {\n  type: 12,\n  data: Buffer.from('my random data')\n}\n\n// 3. create encode stream\nconst wstream = createEncodeStream(protocol)\n\n// 4. connect streams\nwstream.pipe(socket)\n\n// 5.1. encode all your data\nwstream.write(hello)\n\n// 5.2 or use another schema\nencode(anotherPacket, wstream, anotherSchema)\n\n// 5.3 or convert to a buffer\nconst buf = wstream.slice()\n```\n\nSee [stun](https://github.com/nodertc/stun) or [dtls](https://github.com/nodertc/dtls) module for complete example.\n\n## API\n\n* [`decode(rstream: DecodeStream|Buffer, type: PrimitiveType|Object): any`](#decode)\n* [`encode(item: any, wstream: EncodeStream, type: PrimitiveType|Object): void`](#encode)\n* [`encodingLength(item: any, type: PrimitiveType|Object): Number`](#encoding-length)\n* [`createEncodeStream(): EncodeStream`](#create-encode-stream)\n* [`createDecodeStream([buf: Buffer]): DecodeStream`](#create-decode-stream)\n* [Types](#types)\n  * [`(u)int(8, 16, 24, 32, 40, 48)(be, le)`](#types-int)\n  * [`(double, float)(be, le)`](#types-float)\n  * [`array(type: Object, length: number|Object|Function, lengthType: string)`](#types-array)\n  * [`string(length)`](#types-string)\n  * [`bool(type: any)`](#types-bool)\n  * [`buffer(length)`](#types-buffer)\n  * [`reserved(type, count)`](#types-reserved)\n  * [`when(fn: function(context): boolean, type)`](#types-when)\n\n<a name='decode' />\n\n#### `decode(rstream: DecodeStream|Buffer, type: PrimitiveType|Object): any`\n\nReads any data from stream `rstream` using data type `type`. See examples above.\n\n<a name='encode' />\n\n#### `encode(item: any, wstream: EncodeStream, type: PrimitiveType|Object): void`\n\nWrites any data `item` to stream `wstream` using data type `type`. See examples above.\n\n<a name='encoding-length' />\n\n#### `encodingLength(item: any, type: PrimitiveType|Object): Number`\n\nReturn the amount of bytes needed to encode `item` using `type`.\n\n<a name='create-encode-stream' />\n\n#### `createEncodeStream(): EncodeStream`\n\nCreate instance of EncodeStream.\n\n<a name='create-decode-stream' />\n\n#### `createDecodeStream([buf: Buffer]): DecodeStream`\n\nCreate instance of DecodeStream using buffer `buf`.\n\n<a name='types' />\n\n#### `types: Object`\n\nContains all primitive data types.\n\n### Types\n\n<a name='types-int' />\n\n#### `(u)int(8, 16, 24, 32, 40, 48)(be, le)`\n\nLow-level integer types.\n\n```js\nconst schema = {\n  type: int8\n}\n\n// define int64 as buffer and use your loved library for big numbers\nconst int64 = buffer(8)\n```\n\n<a name='types-float' />\n\n#### `(double, float)(be, le)`\n\nLow-level floating-point types.\n\n```js\nconst schema = {\n  size: doublele\n}\n```\n\n<a name='types-array' />\n\n#### `array(type: Object, length: number|Object|Function, lengthType: string)`\n\nArray of low-level or user defined types. Argument `type` should be primitive type or user defined scheme. Argument `length` should be a number, number type or function. Argument `lengthType` should be `bytes` or `count` (default).\n\n```js\narray(uint8, 3) // 3 x uint8\n\nconst schema = {\n  length: uint8,\n  type: uint32be,\n  items: array(uint16, ({node}) => node.length, 'bytes')\n}\n\n// difference between `bytes` or `count`\n\narray(uint16, uint8)\n// |   0x2  | 0x0 0x1 | 0x0 0x2 |\n// | length | item 1  |  item 2 |\n// bytes = 1 + 4, length = 2\n\narray(uint16, uint8, 'bytes')\n// |   0x4  | 0x0 0x1 | 0x0 0x2 |\n// | length | item 1  |  item 2 |\n// bytes = 1 + 4, length = 4\n```\n\n<a name='types-string' />\n\n#### `string(length)`\n\nLow-level string type. Argument `length` can be _number_, _null_ for C - strings, _type_ for size-prefixed data or _function_.\n\n<a name='types-bool' />\n\n#### `bool(type: any)`\n\nConvert provided type to / from boolean. Argument `type` should be an number type.\n\n```js\nconst schema = bool(uint8)\nconst rstream = createDecodeStream(buf) // 0x01 0\n\ndecode(rstream, schema) // return true\ndecode(rstream, schema) // return false\n```\n\n<a name='types-buffer' />\n\n#### `buffer(length)`\n\nLow-level buffer type. Argument `length` can be _number_, number _type_ for size-prefixed data or _function_.\n\n```js\nbuffer(5) // buffer should be 5 bytes\n\nbuffer(uint8) // length prefixed buffer\n// |   0x3  | 0xa 0xb 0xc\n// | length | data\n\nconst packet = {\n  header: {\n    length: uint16be\n  },\n  data: buffer(({node}) => node.header.length % 2) // function should return actual length\n}\n```\n\n<a name='types-reserved' />\n\n#### `reserved(type, count)`\n\nSpecial type to skip any data. Argument `count` should be a number, number type or function.\n\n```js\nconst packet = {\n  type: uint8,\n  _padding: reserved(uint8, 3)\n}\n\ndecode(rstream, packet) // return { type }\n```\n\n<a name='types-when' />\n\n#### `when(fn: function(context): boolean, type)`\n\nSpecial type for conditions. Argument `fn` should be a function and should return boolean value. The `type`\nargument will be evaluated when the first one returns positive value.\n\n```js\nconst schema = {\n  type: uint8,\n  bytes: when(({ node }) => node.type === 1, string(uint16be)),\n  list: when(({ node }) => node.type === 2, array(uint32be, uint8))\n}\n```\n\n### `select(when, ..., defaultType)`\n\nThe second type for conditions. The same as `switch` operator in js. Argument `defaultType` may be any known\n*type* excluding user *schemas*.\n\n```js\nconst schema = {\n  id: uint8,\n  payload: select(when(({ node }) => node.id === 1, string(uint16be)), buffer(uint16be))\n}\n```\n\n## License\n\nMIT, 2017 (c) Dmitriy Tsvettsikh\n","readmeFilename":"README.md","gitHead":"d783103f1941c1779c3ffce28221b55c99f8613c","_id":"binary-data@0.5.0-0","_npmVersion":"5.6.0","_nodeVersion":"9.9.0","_npmUser":{"name":"reklatsmasters","email":"me@reklatsmasters.com"},"dist":{"integrity":"sha512-APjjQ3QW+WLyo2VQzXr/MevdjTsF45FB8H1KNDhY0J2COtiGsmHQb9PlB9980jP2ef6a5PIu3s8syurXvkgJAg==","shasum":"2b46f690d876a5fb77595064b62b14f8bddf809a","tarball":"https://registry.npmjs.org/binary-data/-/binary-data-0.5.0-0.tgz","fileCount":51,"unpackedSize":52909,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbCT9xCRA9TVsSAnZWagAA4EsP/1q67Aj27EPQi8ADxDR4\nu1Dc2fsR4PK1exhf6VssqBBmM4NFxMlxLmc50x2Mdsn4kUQ17c52gUZYjaO1\nda48W9JJiggr0n1Ukq3tkcBDJCPXPv/xYsuRM3jDCmTXbADOXi0u0ZRT53f1\nhQRCauLbN/NlqUQXx4EBvCK+nz+f4TGC71tVI7OoTEJWxVNnsk+qNMUSmnjN\nzMWIogitR5Dm59zH4ElyeLPXreJ7PnJxudIIOQAxsnpCrYF6Gye9fmMuV3P4\nRkiNKhTSsvQUZMDe0ZUJfK7JHtKrVbhT/EWJhzS67/zYE8Qijb3QAUNOHBDv\np3flHQtlY1+CivwoFif57vQ5Q4rNulHde60WtN6mH9bNpAQC6Hdyls9vjCKb\nU/YwNuNeVImadIAod3gYUkqMol91YiSb8yHR31wy/Ld4EzSa7eTLN1rk5g1e\nTaLD1VZlotbRYpU/NoShfDjPgVxoaJwXIGRptsYkB7FExzyoG/LybI2zgQjM\nn6OH+DLm60q3u3f4azSvrPUgTGo9zsRUluNCX8s+4n85IWBcEJ0gIia14QuD\nNZyjChq7qWQh87pdQ0LkxwEQDd1SfyWvDMSW3fFPd/nEnbKDCIGAFWEmBST2\nlXWV7B4eQgC+gS2lv/TSCBz5UKw5prN9R3EAKQrckgLllbufVtqSpJcNlzmP\nh7nH\r\n=B3SJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICMeKDogdEd0XbBBWXTk68GA6898ccQvH9CorXJZA8kJAiAjNNxe5ZuDhpcdD+yxIj3dMhVI8LAEFf7s6Yr5zgmzYg=="}]},"maintainers":[{"name":"reklatsmasters","email":"me@reklatsmasters.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/binary-data_0.5.0-0_1527332720578_0.1965451761563537"},"_hasShrinkwrap":false},"0.5.0":{"name":"binary-data","version":"0.5.0","description":"Declarative encoder/decoder of various binary data.","main":"src/index.js","scripts":{"lint":"npx eslint .","cover":"npx jest --coverage","test":"npm run lint && npx jest","test-ci":"npm run lint && npm run cover"},"repository":{"type":"git","url":"git+https://github.com/reklatsmasters/binary-data.git"},"keywords":["binary","data","buffer","stream","decode","encode","bl","bin-protocol","restructure"],"author":{"name":"Dmitry Tsvettsikh","email":"me@reklatsmasters.com"},"license":"MIT","bugs":{"url":"https://github.com/reklatsmasters/binary-data/issues"},"homepage":"https://github.com/reklatsmasters/binary-data#readme","engines":{"node":">=6"},"dependencies":{"generate-function":"^2.3.1","is-plain-object":"^2.0.3"},"devDependencies":{"@nodertc/eslint-config":"0.2.1","eslint":"^5.6.1","jest":"^23.6.0","prettier":"^1.14.3"},"jest":{"modulePaths":["<rootDir>","<rootDir>/src","<rootDir>/src/node_modules"],"testMatch":["**/test/**/*.js"],"testPathIgnorePatterns":["<rootDir>/node_modules/"],"coverageDirectory":"<rootDir>/coverage","collectCoverageFrom":["**/src/*.js","**/src/node_modules/**/*.js"],"coveragePathIgnorePatterns":["<rootDir>/node_modules/"],"cacheDirectory":".jest-cache","haste":{"providesModuleNodeModules":["internal","lib","streams","types"]}},"eslintConfig":{"extends":"@nodertc","overrides":[{"files":["test/**/*.js"],"env":{"jest":true},"settings":{"import/resolver":{"node":{"moduleDirectory":["node_modules","src","src/node_modules"]}}},"rules":{"require-jsdoc":"off"}},{"files":["benchmark/*.js","examples/*.js"],"rules":{"no-console":"off","require-jsdoc":"off","no-plusplus":"off","no-param-reassign":"off"}}]},"gitHead":"17d0e467fdce646871fa8a23165d320184c667cf","_id":"binary-data@0.5.0","_npmVersion":"6.2.0","_nodeVersion":"10.11.0","_npmUser":{"name":"reklatsmasters","email":"me@reklatsmasters.com"},"dist":{"integrity":"sha512-vJvpeV4JPQbuzVyPCtT2dqocUa+XLZ2b/0wH8eFA6kEbd1rI14uQCz37lc2nCMrKB16qrp6rEcLzYszs8PI+DQ==","shasum":"bfe57b380f2b3801f107fc027e29dc252eedc9e7","tarball":"https://registry.npmjs.org/binary-data/-/binary-data-0.5.0.tgz","fileCount":105,"unpackedSize":1040897,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbwj95CRA9TVsSAnZWagAADW0P/18fy+VwKXFnsYg3kKCP\nxNeBA5jyB7eR4GE1qrUMqMSXRkjNGnxIlqLpz1CJpCsUdEOZbn+4r55E8ylz\nGxFrMByPw8wa6kwjn5XTuYQhZcusEUrKEhIAuOnDObwZwQFIr4ehNOQ8u+i/\nPSbhnyrmVxoDQbNvMeg3vrPGwMZJnl25srjvzTcxgGH+JnYKgKZHkYOOgZtP\n1al8Me3NWQF7ITMvXQNqRQk1YFlh4bsH1HjqN5EAcVhQIKuoBW/QouS19fK4\n+ljve5/UK4kHIizoNMEq2obnBY1tZnf0AbIjPjJx4aGIY2Y13h1iAsPdN4aE\nALoS95SfE7EdXz4EUeR7jpmaE3wsTZAy2/rsobJFpUvWKWfZwtjX1NJx4lEL\nsRu3GcXY6dnZWv6amhT0cjOc37a7ld71pzkPB9LaHUwln8FpqOyDiCm4JAl6\nN/zoofBrydedKJwNXedu7BICrK0Fmq5Ox8R6drh8atJQnjAyUEOzFfAe5TfQ\nnhnB76sdsyPTbnLvOh4/qmIBUQ9RHRn9VE9935EC1LhABcTAxpHm+hXlWGkL\nP/q1jX8qdHnwEDH3r5PxhGxUvvoHKbmzSuVWln2J4LkRIIxi79LhmccDM1wj\n4KbyGQMMP5ln581fq/QSUwwRL131rfIyIJRHD7KW7nJ/KHklQQKh8PlnsMvN\nJ9m4\r\n=QoK8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHHSaNk5b6mouj+bxjnC5bFhFdrU3KXrjfUxc7AKcSXrAiBrbTbrw1/ZJMIlzxhyQCajaPeR2L9S1BO22kVK27fUFg=="}]},"maintainers":[{"name":"reklatsmasters","email":"me@reklatsmasters.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/binary-data_0.5.0_1539456888330_0.921329678136396"},"_hasShrinkwrap":false},"0.6.0":{"name":"binary-data","version":"0.6.0","description":"Declarative binary data encoder / decoder.","main":"src/index.js","scripts":{"lint":"npx eslint .","cover":"npx jest --coverage","test":"npm run lint && npx jest","test-ci":"npm run lint && npm run cover"},"repository":{"type":"git","url":"git+https://github.com/reklatsmasters/binary-data.git"},"keywords":["binary","data","buffer","stream","decode","encode","bl","bin-protocol","restructure","varstruct"],"author":{"name":"Dmitry Tsvettsikh","email":"me@reklatsmasters.com"},"license":"MIT","bugs":{"url":"https://github.com/reklatsmasters/binary-data/issues"},"homepage":"https://github.com/reklatsmasters/binary-data#readme","engines":{"node":">=6"},"dependencies":{"generate-function":"^2.3.1","is-plain-object":"^2.0.3"},"devDependencies":{"@nodertc/eslint-config":"0.2.1","binary":"^0.3.0","bl":"^2.1.2","eslint":"^5.6.1","jest":"^23.6.0","prettier":"^1.14.3"},"jest":{"modulePaths":["<rootDir>","<rootDir>/src","<rootDir>/src/node_modules"],"testMatch":["**/test/**/*.js"],"testPathIgnorePatterns":["<rootDir>/node_modules/"],"coverageDirectory":"<rootDir>/coverage","collectCoverageFrom":["**/src/*.js","**/src/node_modules/**/*.js"],"coveragePathIgnorePatterns":["<rootDir>/node_modules/"],"cacheDirectory":".jest-cache","haste":{"providesModuleNodeModules":["internal","lib","streams","types"]}},"eslintConfig":{"extends":"@nodertc","overrides":[{"files":["test/**/*.js"],"env":{"jest":true},"settings":{"import/resolver":{"node":{"moduleDirectory":["node_modules","src","src/node_modules"]}}},"rules":{"require-jsdoc":"off"}},{"files":["benchmark/*.js","examples/*.js"],"rules":{"no-console":"off","require-jsdoc":"off","no-plusplus":"off","no-param-reassign":"off"}}]},"gitHead":"9d2d3df364e068ccf526f90cada5749a56b6a9c7","_id":"binary-data@0.6.0","_npmVersion":"6.4.1","_nodeVersion":"10.14.1","_npmUser":{"name":"reklatsmasters","email":"me@reklatsmasters.com"},"dist":{"integrity":"sha512-HGiT0ir03tS1u7iWdW5xjJfbPpvxH2qJbPFxXW0I3P5iOzkbjN/cJy5GlpAwmjHW5CiayGOxZ/ytLzXmYgdgqQ==","shasum":"72d635ee9e84199858d472396de0e218f9dfa0f2","tarball":"https://registry.npmjs.org/binary-data/-/binary-data-0.6.0.tgz","fileCount":110,"unpackedSize":1246693,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcDqKTCRA9TVsSAnZWagAAvy8P/R6fNEHdql+kCRPriP69\n/KqVODiPVVNXlOgPuWAs7IvXE2wuw01cYQEWjAomLHRW7AxW4GCFBbiL6bp9\nd7po+WNoJy25TrkIe6k0TGjL4U7CP4u9sJG+mFynlY6EH+kxSiEqRWR9NTDp\nZBTaIK+C/JpyShhZO0sPqQaRt2dsD/Oi9KDEwwz0ot83fAe/7f2hTOP3MzAc\ngshtlbGpLk4uaoQWVFe3cs69Ci0rPsY/ABmXBARKko7yrVfSRR9TotGiKkvH\nljn12rzyvPYkAK+AQPJgKUmmx7gvtmdJlLTjUI/7Ib5oompJLEPN4r+ja68l\nSGZbPJ82udz2nB1YkEEi7kxIa+baoiz1d5GGStxG8dngC+3JFbGZhAm25J/w\naojaAjtFyQWE70LaWbgoWuL7fFW+AdXizV6NlZ/XZt277iT1lD35F6kSXns+\nAT1rk9ixpTyyEmIoRTLMqsPMo2ku6pZnHdcpnnehYrKZmUF3sBfQmRNpElPT\nGf5JLwo24ifThdvxnmzAIoeRk4WbP/TY2+nGEEcE9yjiTL4xdYYQhfWWwPXF\nVte0QVgXppxPhwRNBL5I8UYKZykWFk5eIG+wsmf8MOpB8WGRCiY4ifM+nUsG\n2IvOOWTy0Q9l3LT6GR2NK171RSeZhBwBNo6VaTfdpvyo4Lt8MO/5xICQobXa\ncfaX\r\n=g1vf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCSkvT96F9FWW8DThu7ZJlewjIda2j790S5geeZZ1eiXAIgdC45TqDtOU81tQ7n81PtTgL08xFvfK0sSI4Bj5tSMB4="}]},"maintainers":[{"name":"reklatsmasters","email":"me@reklatsmasters.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/binary-data_0.6.0_1544462994357_0.29467486019765166"},"_hasShrinkwrap":false}},"readme":"# binary-data\n\n[![Build Status](https://travis-ci.org/reklatsmasters/binary-data.svg?branch=master)](https://travis-ci.org/reklatsmasters/binary-data)\n[![npm](https://img.shields.io/npm/v/binary-data.svg)](https://npmjs.org/package/binary-data)\n[![node](https://img.shields.io/node/v/binary-data.svg)](https://npmjs.org/package/binary-data)\n[![license](https://img.shields.io/npm/l/binary-data.svg)](https://npmjs.org/package/binary-data)\n[![downloads](https://img.shields.io/npm/dm/binary-data.svg)](https://npmjs.org/package/binary-data)\n[![Coverage Status](https://coveralls.io/repos/github/reklatsmasters/binary-data/badge.svg?branch=master)](https://coveralls.io/github/reklatsmasters/binary-data?branch=master)\n\nDeclarative binary data encoder / decoder. This module works almost like as [`binary`](https://www.npmjs.com/package/binary) or [`restructure`](https://www.npmjs.com/package/restructure) but provided modern and clean api. It inspired by [abstract-encoding](https://github.com/mafintosh/abstract-encoding) interface.\n\n### Support\n\n[![Buy Me A Coffee](https://www.buymeacoffee.com/assets/img/custom_images/purple_img.png)](https://www.buymeacoffee.com/reklatsmasters)\n\n## Usage\n\n#### decode\n\n```js\nconst { decode, createDecode, types: { uint8, array, string } } = require('binary-data')\n\n// 1. Define your own schema as plain object\nconst protocol = {\n  type: uint8,\n  value: array(string(null), uint8)\n}\n\nconst message = Buffer.from([1, 2, 3, 4, 5, 6, 0]);\n\n// Just decode message\nconst packet = decode(message, protocol)\n\n// 2 Also you may decode messages from streams\nconst net = require('net');\n\nconst socket = net.createConnection({ port: 8124 });\nconst istream = createDecode(protocol);\n\nsocket.pipe(istream).on('data', packet => {\n  console.log(packet.type, packet.value);\n});\n```\n\n#### encode\n\n```js\nconst { encode, createEncode, types: { uint8, string } } = require('binary-data')\n\nconst protocol = {\n  type: uint8,\n  value: string(uint8)\n}\n\nconst hello = {\n  type: 12,\n  value: 'my random data'\n}\n\n// Just encode message\nconst ostream = encode(hello, protocol);\nconst packet = ostream.slice();\n\n// Or you may encode messages into a stream\nconst net = require('net');\n\nconst ostream = createEncode(protocol);\nconst socket = net.createConnection({ port: 8124 }, () => {\n  ostream.write(hello);\n});\n\nostream.pipe(socket);\n\n// You may combine multiple schemes into one stream\nconst ostream = createEncode();\n\nencode(obj1, ostream, protocol1);\nencode(obj2, ostream, protocol2);\nencode(obj3, ostream, protocol3);\n\nconst packet = ostream.slice();\n\n```\n\nSee [stun](https://github.com/nodertc/stun) or [dtls](https://github.com/nodertc/dtls) module for complete example.\n\n## Perfomance\n\nDecoding DTLS ClientHello packet, *nodejs 10.14.1 / Ubuntu 16.04 x64*\n\n|name|time|\n|---|---|\n|binary data|637.900ms|\n|binary|2229.218ms|\n\n## API\n\n* [`encode(obj: any, [target: BinaryStream], type: Object): BinaryStream`](#encode)\n* [`decode(source: BinaryStream|Buffer, type: Object): any`](#decode)\n* [`encodingLength(item: any, type: Object): Number`](#encoding-length)\n* [`createEncodeStream([type: Object]): BinaryStream`](#create-encode-stream)\n* [`createDecodeStream([type: Object|Buffer]): BinaryStream`](#create-decode-stream)\n* [`createEncode([type: Object]): BinaryStream`](#create-encode-stream)\n* [`createDecode([type: Object|Buffer]): BinaryStream`](#create-decode-stream)\n* [Types](#types)\n  * [`(u)int(8, 16, 24, 32, 40, 48)(be, le)`](#types-int)\n  * [`(double, float)(be, le)`](#types-float)\n  * [`array(type: Object, length: number|Object|Function, lengthType: string)`](#types-array)\n  * [`string(length)`](#types-string)\n  * [`bool(type: any)`](#types-bool)\n  * [`buffer(length)`](#types-buffer)\n  * [`reserved(type, count)`](#types-reserved)\n  * [`when(fn: function(context): boolean, type)`](#types-when)\n\n<a name='decode' />\n\n#### `decode(source: BinaryStream|Buffer, type: Object): any`\n\nReads any data from stream `rstream` using data type `type`. See examples above.\n\n<a name='encode' />\n\n#### `encode(obj: any, [target: BinaryStream], type: Object): BinaryStream`\n\nWrites any data `obj` to stream `target` using data type `type`. See examples above.\n\n<a name='encoding-length' />\n\n#### `encodingLength(item: any, type: Object): Number`\n\nReturn the amount of bytes needed to encode `item` using `type`.\n\n<a name='create-encode-stream' />\n\n#### `createEncodeStream([type: Object]): BinaryStream`\n#### `createEncode([type: Object]): BinaryStream`\n\nCreate instance of BinaryStream.\n\n<a name='create-decode-stream' />\n\n#### `createDecodeStream([type: Object|Buffer]): BinaryStream`\n#### `createDecode([type: Object|Buffer]): BinaryStream`\n\nCreate instance of BinaryStream.\n\n<a name='types' />\n\n#### `types: Object`\n\nContains all primitive data types.\n\n### Types\n\n<a name='types-int' />\n\n#### `(u)int(8, 16, 24, 32, 40, 48)(be, le)`\n\nLow-level integer types.\n\n```js\nconst schema = {\n  type: int8\n}\n\n// define int64 as buffer and use your loved library for big numbers\nconst int64 = buffer(8)\n```\n\n<a name='types-float' />\n\n#### `(double, float)(be, le)`\n\nLow-level floating-point types.\n\n```js\nconst schema = {\n  size: doublele\n}\n```\n\n<a name='types-array' />\n\n#### `array(type: Object, length: number|Object|Function, lengthType: string)`\n\nArray of low-level or user defined types. Argument `type` should be primitive type or user defined scheme. Argument `length` should be a number, number type or function. Argument `lengthType` should be `bytes` or `count` (default).\n\n```js\narray(uint8, 3) // 3 x uint8\n\nconst schema = {\n  length: uint8,\n  type: uint32be,\n  items: array(uint16, ({node}) => node.length, 'bytes')\n}\n\n// difference between `bytes` or `count`\n\narray(uint16, uint8)\n// |   0x2  | 0x0 0x1 | 0x0 0x2 |\n// | length | item 1  |  item 2 |\n// bytes = 1 + 4, length = 2\n\narray(uint16, uint8, 'bytes')\n// |   0x4  | 0x0 0x1 | 0x0 0x2 |\n// | length | item 1  |  item 2 |\n// bytes = 1 + 4, length = 4\n```\n\n<a name='types-string' />\n\n#### `string(length)`\n\nLow-level string type. Argument `length` can be _number_, _null_ for C - strings, _type_ for size-prefixed data or _function_.\n\n<a name='types-bool' />\n\n#### `bool(type: any)`\n\nConvert provided type to / from boolean. Argument `type` should be an number type.\n\n```js\nconst schema = bool(uint8)\nconst rstream = createDecodeStream(buf) // 0x01 0\n\ndecode(rstream, schema) // return true\ndecode(rstream, schema) // return false\n```\n\n<a name='types-buffer' />\n\n#### `buffer(length: Object|null|number)`\n\nLow-level buffer type. Argument `length` can be _number_, number _type_ for size-prefixed data, _function_ or _null_.\n\n```js\nbuffer(5) // buffer should be 5 bytes\n\nbuffer(uint8) // length prefixed buffer\n// |   0x3  | 0xa 0xb 0xc\n// | length | data\n\nconst packet = {\n  header: {\n    length: uint16be\n  },\n  data: buffer(({node}) => node.header.length % 2) // function should return actual length\n}\n```\n\n<a name='types-reserved' />\n\n#### `reserved(type, count)`\n\nSpecial type to skip any data. Argument `count` should be a number, number type or function.\n\n```js\nconst packet = {\n  type: uint8,\n  _padding: reserved(uint8, 3)\n}\n\ndecode(rstream, packet) // return { type }\n```\n\n<a name='types-when' />\n\n#### `when(fn: function(context): boolean, type)`\n\nSpecial type for conditions. Argument `fn` should be a function and should return boolean value. The `type`\nargument will be evaluated when the first one returns positive value.\n\n```js\nconst schema = {\n  type: uint8,\n  bytes: when(({ node }) => node.type === 1, string(uint16be)),\n  list: when(({ node }) => node.type === 2, array(uint32be, uint8))\n}\n```\n\n### `select(when, ..., defaultType)`\n\nThe second type for conditions. The same as `switch` operator in js. Argument `defaultType` may be any known\n*type* excluding user *schemas*.\n\n```js\nconst schema = {\n  id: uint8,\n  payload: select(when(({ node }) => node.id === 1, string(uint16be)), buffer(uint16be))\n}\n```\n\n## License\n\nMIT, 2017 (c) Dmitriy Tsvettsikh\n","maintainers":[{"name":"reklatsmasters","email":"me@reklatsmasters.com"}],"time":{"modified":"2022-04-11T17:48:35.389Z","created":"2017-07-24T17:41:02.966Z","0.1.0":"2017-07-24T17:41:02.966Z","0.2.0":"2018-01-21T23:13:51.335Z","0.2.1":"2018-02-23T19:03:41.649Z","0.3.0":"2018-03-09T11:09:12.480Z","0.4.0":"2018-05-01T06:45:40.114Z","0.5.0-0":"2018-05-26T11:05:20.680Z","0.5.0":"2018-10-13T18:54:48.533Z","0.6.0":"2018-12-10T17:29:54.530Z"},"homepage":"https://github.com/reklatsmasters/binary-data#readme","keywords":["binary","data","buffer","stream","decode","encode","bl","bin-protocol","restructure","varstruct"],"repository":{"type":"git","url":"git+https://github.com/reklatsmasters/binary-data.git"},"author":{"name":"Dmitry Tsvettsikh","email":"me@reklatsmasters.com"},"bugs":{"url":"https://github.com/reklatsmasters/binary-data/issues"},"license":"MIT","readmeFilename":"README.md"}