{"_id":"buffer-json-encoding","_rev":"4-4848bf1b2ae36b9148dd140d1331ddaa","name":"buffer-json-encoding","dist-tags":{"latest":"1.0.2"},"versions":{"0.1.0":{"name":"buffer-json-encoding","version":"0.1.0","description":"An abstract-encoding compatible JSON encoder/decoder that properly encodes/decodes buffers.","main":"index.js","scripts":{"test":"node test.js"},"keywords":["json","json-buffer","buffer","abstract-encoding","encode","decode"],"author":{"name":"harry lachenmayer","email":"harrylachenmayer@gmail.com"},"license":"ISC","dependencies":{"buffer-json":"^1.0.0"},"devDependencies":{"tape":"^4.9.2"},"gitHead":"c46831ebfcc2a423dab63f04cd529f1dd2ac1ace","_id":"buffer-json-encoding@0.1.0","_npmVersion":"6.5.0","_nodeVersion":"11.6.0","_npmUser":{"name":"lachenmayer","email":"harrylachenmayer@gmail.com"},"dist":{"integrity":"sha512-3esfUaoPWqKjQePm/G90euOWkr46phSbHO7RcgRAoJrMWg+RE80ITulKeDHI/0ADR45RJCYIRr6EvIf1XLh8mA==","shasum":"5171987998d4c8402d21041afe0b5d7f093ea248","tarball":"https://registry.npmjs.org/buffer-json-encoding/-/buffer-json-encoding-0.1.0.tgz","fileCount":4,"unpackedSize":5673,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcXfilCRA9TVsSAnZWagAAlEsP/0EoHaCT42Nxhnoh18kc\nTZGOF5ycVMyaPrdZW52mssvrZ1pQ7DcnzMG516qZogpQF6X1VdXKyxzRlqnH\nRA59TTnKShKxE/ojQT+ZyIo2VBfdmGLi8mdkIOxZYtoP96rWtv3nWChTRyj8\nnNSxAxtIV7hS/rbyN32zbrg/s14wBE2sX9NH7BaR5xYhNEwTnaobEFFwIUCO\nC5Igk84Bq4KYoKaqdCU16jT6T8OVTVWk051+3dOaZ+5FXO4A/WnY2lA4PiO9\nR8GcmymsSaco0AarOIT90W954V0QxwshtUIZXugzmbjjSx/sGdMG1oG7KO37\n0othtmo0TsHt7JreEQ0yJQ5i2UFMzrWBBZyojYExahizN25X4aOCTwC1DbKB\nkz+Rg4QyOQ4wk881t4cV9wy7HwOxJx8L+MLHeuSWJln7LsYkw2ehEpC2pX5P\ndUVy3WD8HxuB2IHTEKZ0a6HuvN+J+ccWQx05VVaFukDBkszlIyCwFwcbogwT\nCBvIANbjYAP6tiK6ZciDUkGzaK1FeZmdR6eQnJBcCZXCZ79PJI1c5aIkXJWT\n5y30agTQM+GuDkQLCJS5AWL4ONkBArRkmOMBgD4dpLe2kK44PblAugHdCcMO\nAhTIK1JJHwmSsrwYvlHk3XL7Iv3dObHr/heaSvAzS6c9hXktEaPl1NANUT1n\nUqFW\r\n=7z1B\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCu/+9VKs0BfY57LMSEEu6cufyZeXIGbp6lm5U7QL3O3AIgU6OL3edj4mS79okuzs1Jk8964pSF9ypkPiVRLjsvC4U="}]},"maintainers":[{"name":"lachenmayer","email":"harrylachenmayer@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/buffer-json-encoding_0.1.0_1549662373170_0.7309445093934896"},"_hasShrinkwrap":false},"1.0.0":{"name":"buffer-json-encoding","version":"1.0.0","description":"An abstract-encoding compatible JSON encoder/decoder that properly encodes/decodes buffers.","main":"index.js","scripts":{"test":"node test.js"},"keywords":["json","json-buffer","buffer","abstract-encoding","encode","decode"],"author":{"name":"harry lachenmayer","email":"harrylachenmayer@gmail.com"},"license":"ISC","dependencies":{"@lachenmayer/buffer-json":"^1.0.1"},"devDependencies":{"tape":"^4.9.2"},"gitHead":"0588829f319da4de526441906e6fe85e210a920e","_id":"buffer-json-encoding@1.0.0","_npmVersion":"6.5.0","_nodeVersion":"11.6.0","_npmUser":{"name":"lachenmayer","email":"harrylachenmayer@gmail.com"},"dist":{"integrity":"sha512-z7irnCHfnqdgfz6MNy/o730JQiuxQwnOOlk5b0vaP9yI1Xjf7OAMjNDKQI2/5U94BtAiIP9oTuxIKT8gGc70nw==","shasum":"531adc45206368dea1fc2f01fd9ec7882eeb4efe","tarball":"https://registry.npmjs.org/buffer-json-encoding/-/buffer-json-encoding-1.0.0.tgz","fileCount":4,"unpackedSize":5696,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcZYMbCRA9TVsSAnZWagAAo9wP/2p4JDvfJPFGOpiZrFpX\nYhng/gwnQrDl2naJtnSXfjb+1on1I0THWmmQxddWVQaE5KuDsK5c5qYvhBCF\nld2EBJz+7zueCM0gDfAll1g9Osy0rjAdreyW2iTLFAJE0DNotBmCGuP6Cr8z\nRJzRB9dcI85FhlWd0USipT4RB8yqAuJAu5mFO9ItJ+uayjMQ9SFpmtMaxpQs\nJ7i97MjbaADb2DLB0ojkBKQ2KdPCsYRLPS0pH1CXaoROfnt8xmBxcPKR40sh\nAoD0C8PmKfkQ/eVw/P6jnXzGckly+g56IZlt8al3LTD7NJeHs3I5vjjM5JAM\n/76QEVCP6e7BpgkJnrxAA+Nz60vauga889W89YGojiFHug6RoAH/MBkOHxub\nqEwolwPawT0+uP07dNsghR+/ir+l6qnXtF7FXfhsP7O7Q1yMir66mgwGiq0L\nYcVA7gYPMSPIK5VchXi/LRHxS6cjhBZJdDJiIKhC3AMHk5oMzU+ubTCDteFj\nNEhqXOO80GMQjqJ6kJjF1qEC7QuxDmHLOpvMj1Rxw3mpoON9TphOqPXjodMM\n1rFN6eB1wZkMB9cpyx9vgEBdmKTARcqzMOiqDzopNkjR+BdgWOdy9e8KuRn/\nW5Z00YhD1zcdmZMCk2jVh6cfAfAjfELvDC82HDX5sbJ5sP2sGEZ2vFoLnt2+\n4PUs\r\n=Ve3o\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDalpLT7DrDK4EGgJL4w/ymtbiTHNsbWVqDkYX3ojeTuQIgE523r6LRaSC8li2XZ+wg2DpC7Tzi9rgeZOpQBRBCd/0="}]},"maintainers":[{"name":"lachenmayer","email":"harrylachenmayer@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/buffer-json-encoding_1.0.0_1550156571290_0.19119336323182679"},"_hasShrinkwrap":false},"1.0.1":{"name":"buffer-json-encoding","version":"1.0.1","description":"An abstract-encoding compatible JSON encoder/decoder that properly encodes/decodes buffers.","main":"index.js","scripts":{"test":"standard --fix && node test.js"},"keywords":["json","json-buffer","buffer","abstract-encoding","encode","decode"],"author":{"name":"harry lachenmayer","email":"harrylachenmayer@gmail.com"},"license":"ISC","dependencies":{"@lachenmayer/buffer-json":"^1.0.1"},"devDependencies":{"standard":"^12.0.1","tape":"^4.9.2"},"gitHead":"542cb05a6cc4fe700eb601ec11e4d63120c36d36","_id":"buffer-json-encoding@1.0.1","_npmVersion":"6.5.0","_nodeVersion":"11.6.0","_npmUser":{"name":"lachenmayer","email":"harrylachenmayer@gmail.com"},"dist":{"integrity":"sha512-7D2Q234MVdDL6nySPh0+qz0SoOJ/DFFTLbjs7ITTFQopT23HEwHOHIfJUb8iwItKPUYq3BwYp/yDMuCPjzikcA==","shasum":"bb5c96398d4aa43b6a8a1a51187c572832b22bb6","tarball":"https://registry.npmjs.org/buffer-json-encoding/-/buffer-json-encoding-1.0.1.tgz","fileCount":4,"unpackedSize":6366,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcdBWbCRA9TVsSAnZWagAAyvkP/R3Yt349AgXSP+JUSutW\nyNDXJHFXzgMcr0c86pTSEbUMWKmNf25ZEIcAYmdDsh/qoCOWtiJ05s9xNqrQ\nWDtk3Cz3JtmIvlMbZNEFT3zpaKNFGSocQVyc1f5R5jafZmzzMq/9vMjYqAWl\nw4ln81ith20DlogV/S4T+QHU47VcCZQYEQRCiTnjT34YLPovoggpta6YkarB\n1jUZXiLuxskVxBqdx12ZXGyhZZUPz1V5XjjoDBz2L8BQnswuL/RxaA10eALB\nyuCu89FtijJ8b884Q3MOPBmxBJ5EyFdtjHyoN1xAy9houT7rtER8T7MY1x36\nkzVJqkeAy59UoK2cs13p3fhC7oHO0sEQR8FWJb9TYa+5SQK9R0Ow5FNK2qO3\nPhmboywv8MSyCmW80Hh4VL8GjLDsf/0uambR0zjcUjhpH1kVZEgoZiK0cZpN\nPQ+WSk1liCJ9tKkXFiDQKZqBZcxdQK4/mtWhhQF2wcoxg7/3Rav9yP3S11ou\nRg0v4jNkGGwPzduQALkRPxBsBW505hk5SmOL7k7W0gSUGIVl/xBsGrf6sFb2\nlqv9LvavbSZW+SvDQmgTjKMvxTc315qun06sVsE6kZSicEvzBs2gNZHydfGE\nbw7ctz8Nd9Cfn19dO1xiUyzno2UiDzotnJTSZZIQ95qyrDHrPoCr7hOZRmyB\njhIB\r\n=iJ3R\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHiC2RHm/MFt7/OrEgrdWtsw3bRrn+I3IQHmhwtB7pVzAiEAydbT1cOU/hat9qE5gjkLDLr3L+zTHPll/sDY16L8uBc="}]},"maintainers":[{"name":"lachenmayer","email":"harrylachenmayer@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/buffer-json-encoding_1.0.1_1551111578526_0.3069061425616191"},"_hasShrinkwrap":false},"1.0.2":{"name":"buffer-json-encoding","version":"1.0.2","description":"An abstract-encoding compatible JSON encoder/decoder that properly encodes/decodes buffers.","main":"index.js","scripts":{"test":"standard --fix && node test.js"},"keywords":["json","json-buffer","buffer","abstract-encoding","encode","decode"],"author":{"name":"harry lachenmayer","email":"harrylachenmayer@gmail.com"},"license":"ISC","dependencies":{"buffer-json":"^2.0.0"},"devDependencies":{"standard":"^12.0.1","tape":"^4.9.2"},"gitHead":"6224d237ec93b2cc86a5e3b73a3c2a44e9bfcf4e","_id":"buffer-json-encoding@1.0.2","_npmVersion":"6.5.0","_nodeVersion":"11.6.0","_npmUser":{"name":"lachenmayer","email":"harrylachenmayer@gmail.com"},"dist":{"integrity":"sha512-zH4Q0aqJnv0xPVX+Imcp+EbiyYg9xq7//mvShmQ08E6wC1EeYg2+1OG2n9EEu0rfiuYjP+j5LsSmQVufdqflrg==","shasum":"f2034ca52b9aa628d40b35264d504f50566fcba4","tarball":"https://registry.npmjs.org/buffer-json-encoding/-/buffer-json-encoding-1.0.2.tgz","fileCount":4,"unpackedSize":6340,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcdG9WCRA9TVsSAnZWagAAUZ8P+wQMmXnFwS8hYUwm5eLr\n4iQM5poOKGTB4YTxPLfEDCtnkP8wdvvgOEF3zzBAWhi7KOcw8r6aP/lBteYs\nDCFPPdSFIQmJHJ+2vCaGsd6EscJuBBk0EqOxuLDNdBAEeUghRFWa+vP4djG8\nsAn4IhlEw80Zdni3tlZukB8chkHQHJmoMjbfqA0V+EU8foGjNZF02Ml76UP8\n3HWGH77K7X0xCOh1GNaGPdMaraMPazv+Xo7cKzywScUo6BhQ2E/hE9afoj9p\nMFcbB97VYM1rB6KTR31hL202ynWfdRrXfc8VrqQMaPmgkW4dTmL7ZI4Q4bB2\n97Mvc/07xzvAGGf+DgI2HC1fSIbmATn5nWpWG0WKQx4rFKJYSrmQ773EkZ87\nc8sd2XRzWbeqS6dO8Z5XvHVZNJxfAY6Xkq8CQPGcYuZjgcFfnIlFk40KLDjN\nbUHhTF+vXG7ki12QttxiS2uHM/XLRqh6CdlaGMdzagQgIPEggbZ6O2N053MO\nd8m9QxL6HO9Ibhbkf7OzJ26VuEWHvmHHeZh2Pul30rdXDOU43SiaxvoQgMcV\nAv2Da9lygUMwa2YD/7b+GL6/mfUO7bCNit4mXnMLoiRFWszDB0Fwf1h26lib\noz2Agil96ayjbNdELXLTlbeQRC3pTwa9GbDUPUlaxWXLWbhEKU+wjYZWusS0\nI6VE\r\n=lMGw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEc6rxLQQdbdTBH9WUow9NCnddufLMFA1Nt8ykFExrRnAiAbMqlEe1kFp9vktXuTAmE2pbAXdVTY/9pPYJMCpa3NDA=="}]},"maintainers":[{"name":"lachenmayer","email":"harrylachenmayer@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/buffer-json-encoding_1.0.2_1551134549689_0.7891109770987792"},"_hasShrinkwrap":false}},"time":{"created":"2019-02-08T21:46:13.170Z","0.1.0":"2019-02-08T21:46:13.289Z","modified":"2022-04-12T04:39:11.934Z","1.0.0":"2019-02-14T15:02:51.403Z","1.0.1":"2019-02-25T16:19:38.753Z","1.0.2":"2019-02-25T22:42:29.892Z"},"maintainers":[{"name":"lachenmayer","email":"harrylachenmayer@gmail.com"}],"description":"An abstract-encoding compatible JSON encoder/decoder that properly encodes/decodes buffers.","keywords":["json","json-buffer","buffer","abstract-encoding","encode","decode"],"author":{"name":"harry lachenmayer","email":"harrylachenmayer@gmail.com"},"license":"ISC","readme":"# buffer-json-encoding\n\n[![abstract-encoding](https://img.shields.io/badge/abstract--encoding-compliant-brightgreen.svg?style=flat)](https://github.com/mafintosh/abstract-encoding)\n\nAn [`abstract-encoding`](https://github.com/mafintosh/abstract-encoding) compatible JSON encoder/decoder that properly encodes/decodes buffers.\n\nThe reason this module exists is that JSON does not have a built-in data type for binary data, so Node.js by default encodes a buffer as an object of shape `{ type: \"Buffer\", data: [...] }`. The issue is that Node.js does not decode these objects as Buffer instances, which is not very useful if you actually want to do something with them.\n\nThis module depends on [`buffer-json`](https://www.npmjs.com/package/@lachenmayer/buffer-json) which provides a [_replacer_](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#The_replacer_parameter) & [_reviver_](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse) for use with `JSON.stringify` & `JSON.parse` respectively. Buffer data is encoded as a base64-encoded string, rather than as an array of numbers. Buffers are decoded as expected with both (base-64 & array) encodings.\n\n## API\n\n```\nbuffer = encode(obj, [buffer], [offset])\nobj = decode(buf, [start], [end])\nnumber = encodingLength(obj)\n```\n\nSee [`abstract-encoding`](https://github.com/mafintosh/abstract-encoding) for more details.\n\n","readmeFilename":"readme.md"}