{"_id":"@ellipticoin/cbor","_rev":"1-0299eb9dfa863384f9c58c7e51374da4","name":"@ellipticoin/cbor","dist-tags":{"latest":"1.0.4"},"versions":{"1.0.4":{"name":"@ellipticoin/cbor","version":"1.0.4","description":"CBOR encode/decode (synchronous, semantic, browser-compatible)","homepage":"https://github.com/ellipticoin/js-cbor","bugs":{"url":"https://github.com/ellipticoin/js-cbor/issues"},"keywords":["cbor"],"maintainers":[{"name":"masonforest","email":"mason@kissr.co"}],"main":"main.js","scripts":{"test":"grunt mochaTest","format":"./node_modules/prettier/bin-prettier.js --write *.js test/**/*.js"},"devDependencies":{"chai":"~1.8.1","grunt":"~0.4.1","grunt-cli":"~0.1.9","grunt-mocha-test":"~0.7.0","prettier":"~2.2.1"},"repository":{"type":"git","url":"https://github.com/ARMmbed/cbor-sync.git"},"license":"MIT","dependencies":{"bigint-buffer":"^1.1.5"},"licenseText":"Copyright (c) 2014 ARM Ltd.\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.","_id":"@ellipticoin/cbor@1.0.4","dist":{"shasum":"de5c5eb2aba9cee93a0a944fae2258171e231dd5","integrity":"sha512-BD1kzgcYtr2RfG3yXl4aagJnyNpqo5snhzTUyWo1ss7GYSZRqIpEpc78NTm+fYCJ5n7TWrCUKBOqxQfhAkIyBQ==","tarball":"https://registry.npmjs.org/@ellipticoin/cbor/-/cbor-1.0.4.tgz","fileCount":22,"unpackedSize":39840,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf6yzBCRA9TVsSAnZWagAAXVMQAJJ5E2Jbhz9UMs46lO9n\nYmXQDfteDzmeaOGYExEDt8fIaqbbGaJH2ldEoUjsCJQVCi+KK7oYhZHDa8f7\nhUirFc92nk9wHZ9yNoeYQhv99JHyphbLoAIEO+Jcx2LRop3jhhr0XmNYISNT\n+GpEW+uaN1T1CYiLc5PwOGRKFeOa6hQ6th0tR8HTEdn5WM6CoahdJCcXcb9s\nADVuR/FoWD7rgz1G7dL5S4PuKlmoYDIiu/VtFQraitIkUClj42BJrMBaKlQE\n1jI/UXhfutvvgkf2t5wfArwbRG1iauW+ssU1zLqM39jl6oJX9uEldyJqqXeb\n3WfWKA+Z6P5hmPF5iJ1WFH71k3J/mv2SfgmpVdB2GFR+bgBrZ9AY0HFRu8MC\nZhyGPgeSHRz50auUeU57b1rXOEkhCA2bDOuJ+zbFxpRNfm9e6Eatgo3OgZbF\nUx8eQkbXAajkvDugRc57tYzSOjU3VHOUK/oGuxnKJS6LNyemZCKwDWT5FyGK\nv1ZMnN18y0394qsX280yRjehUlneVORG4szHAFzNvsz1TjMmNteqDEz7HAjx\nFUaLkyhi9SJ7+vDWKe59Kgivo/tj17y5gqL1Qy2dllwhIEZLXKMm1XC5XjMl\nc4071vzw8RlLkIhCIcQKuyKn4bnhOwNtMI01FZv7/wkOkSrqetKHpw0AtBXJ\nWkC0\r\n=rj1r\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCT/ScNztrcWpVktxeJlDtepQDbMZsA8lOE+KeuV7mfwQIhAKIhLJWWHODd0YAF7ligccAE3A7UM1/yOWeXT5nccDDs"}]},"_npmUser":{"name":"masonforest","email":"mason@kissr.co"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cbor_1.0.4_1609247937385_0.2699494722633995"},"_hasShrinkwrap":false}},"time":{"created":"2020-12-29T13:18:57.147Z","1.0.4":"2020-12-29T13:18:57.537Z","modified":"2022-04-05T07:20:38.619Z"},"maintainers":[{"name":"masonforest","email":"mason@kissr.co"}],"description":"CBOR encode/decode (synchronous, semantic, browser-compatible)","homepage":"https://github.com/ellipticoin/js-cbor","keywords":["cbor"],"repository":{"type":"git","url":"https://github.com/ARMmbed/cbor-sync.git"},"bugs":{"url":"https://github.com/ellipticoin/js-cbor/issues"},"license":"MIT","readme":"# Encode/decode CBOR\n\n[![Build Status](https://travis-ci.org/ARMmbed/cbor-sync.svg?branch=master)](https://travis-ci.org/ARMmbed/cbor-sync) [![NPM version](https://badge.fury.io/js/cbor-sync.png)](http://badge.fury.io/js/cbor-sync)\n\nThis package provides an extensible CBOR encoder/decoder.\n\n## Usage\n\n```javascript\nvar CBOR = require('cbor-sync');\n\nvar encodedBuffer = CBOR.encode({hello: 'world'});\nvar decodedObject = CBOR.decode(encodedBuffer);\n```\n\n## `toCBOR()`\n\nMuch like the `toJSON()` method, which allows objects to provide a replacement representation for encoding, this package checks for a `toCBOR()` method.\n\nNote that this step happens *after* any semantic-tagging/-replacement step, so a custom semantic encoder will always override an objects built-in `toCBOR()` method.\n\n## Semantic extensions\n\nCBOR provides a limited set of basic types (similar to JSON), but provides semantic tagging (optional for both encoder/decoder) that lets you annotate parts of the data so they can be decoded appropriately.\n\nHere is an example (from this module) for encoding Date objects as ISO strings:\n\n```javascript\n// 0 is the CBOR semantic tag number for date/time strings: https://tools.ietf.org/html/rfc7049#section-2.4\nCBOR.addSemanticEncode(0, function (data) {\n\tif (data instanceof Date) {\n\t\treturn data.toISOString();\n\t}\n});\nCBOR.addSemanticDecode(0, function (dateString) {\n\treturn new Date(dateString);\n});\n```\n\n## Known issues\n\n* All floats encoded as 64-bit, regardless of whether they strictly need to be\n","readmeFilename":"README.md"}