{"name":"borc","version":"2.1.2","description":"Encode and parse data in the Concise Binary Object Representation (CBOR) data format (RFC7049).","main":"./src/index.js","repository":{"type":"git","url":"git+https://github.com/dignifiedquire/borc.git"},"homepage":"https://github.com/dignifiedquire/borc.git","browser":{"fs":false},"scripts":{"test":"aegir test --files test/**/*.spec.js","test:browser":"aegir test --target browser","test:node":"aegir test --target node","lint":"aegir lint","docs":"aegir docs","release":"aegir release --docs","release-minor":"aegir release --type minor","release-major":"aegir release --type major","build":"aegir build","coverage":"aegir coverage","coverage-publish":"aegir coverage --upload","bench":"node benchmarks/index.js","bench-browser":"budo benchmarks/index.js"},"keywords":["coap","cbor","json","asm","asm.js"],"author":{"name":"Friedel Ziegelmayer","email":"dignifiedquire@gmail.com"},"devDependencies":{"aegir":"^21.4.5","ava":"^3.5.1","benchmark":"^2.1.0","budo":"^11.2.0","cbor":"^4.0.0","chai":"^4.1.2","dirty-chai":"^2.0.1","garbage":"0.0.0"},"license":"MIT","dependencies":{"bignumber.js":"^9.0.0","buffer":"^5.5.0","commander":"^2.15.0","ieee754":"^1.1.13","iso-url":"~0.4.7","json-text-sequence":"~0.1.0","readable-stream":"^3.6.0"},"engines":{"node":">=4"},"contributors":[{"name":"Joe Hildebrand","email":"joe-github@cursive.net"},{"name":"Patrick Gansterer","email":"paroga@paroga.com"},{"name":"Hugo Dias","email":"hugomrdias@gmail.com"},{"name":"Tobias Wich","email":"tobias.wich@ecsec.de"},{"name":"Rüdiger Klaehn","email":"rklaehn@gmail.com"},{"name":"Scorpi","email":"cobblebone@gmail.com"},{"name":"Alan Shaw","email":"alan.shaw@protocol.ai"},{"name":"Benjamin Cabé","email":"kartben@gmail.com"},{"name":"Ryan Pendergast","email":"ryan.pendergast@gmail.com"}],"gitHead":"f8b6b7630250e2ee5509f7104529490a388c2cc7","bugs":{"url":"https://github.com/dignifiedquire/borc/issues"},"_id":"borc@2.1.2","_nodeVersion":"13.11.0","_npmVersion":"6.13.7","dist":{"integrity":"sha512-Sy9eoUi4OiKzq7VovMn246iTo17kzuyHJKomCfpWMlI6RpfN1gk95w7d7gH264nApVLg0HZfcpz62/g4VH1Y4w==","shasum":"6ce75e7da5ce711b963755117dd1b187f6f8cf19","tarball":"http://registry-npm.ywwl.com/borc/download/borc-2.1.2.tgz","fileCount":19,"unpackedSize":1037702,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJefOwZCRA9TVsSAnZWagAAGC0P/1iwfRpI1VmKpFTJgiJj\nuG1q5WLgXPzSPBz2rJPcM5JxP8JJjFO1MAACD6o9shVGBpflEcMkhC7gLC1c\nWs0Cxh8+qt4JXZDtlWruGQHT43MZNuPMfc1wr63KpWp/y9UEWDgWIMSLdrr5\nI7/KnVk3msgYaDiMaB4K2zXAoAH6Z0Ve32Bjw0pI881tX7dWJVU0VyamFspm\ntv7NjOww16RODT2K72iXRpYV13XMfUtSX2zM75GeZZbLZvkz39ISxoHxZjl2\nQc/JMM1eiz2KC8ervzYF86kgV07OzpiXVkDWRjn0nLxIA0/GKPHHfOyN5OdW\n/gXsBasqnn4ntComDH/ZbOnlykh6eHvwU+l/mPDV313ZuO3W2k2uye1NsaX+\njTa5eSYgbH754TFux+HaULFJ2T0tP/ByVuXIzJDObA8IPR/C8v24YZFsZAUC\nxmpgP6ZGcnPr5WoDFmTEejeac+Bp53kUEW6feIa0RPMmILTFAw14fa911fnz\nT+YpZj/vqxLnpHFUtUIkiXurqTVCCLp58Q+2aXkIuBx+lGcX3/1n0xOCawuL\n+l01Ft0On1kWKH5i0lv7ij4NNu/5Y00TztRGQFZDsizihxb4uuuBlHF3e5XZ\niYUhxu8OWdQSug5unS2wlSKj+N2do3vDRaJSYN2fJAqqfw+LTc4E8YB/qMS9\nbDr+\r\n=uech\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDje/9lP4Z5FvAz07oPZ1DT2fcBbxLZnGw6K51oPvBzTAiEA5WeAWh01Q3ghkgmR9GxQQxVq03Kvt32QhevqnDp/lwA="}],"size":254491,"noattachment":false,"key":"/borc/-/borc-2.1.2.tgz"},"maintainers":[{"name":"daviddias","email":"daviddias.p@gmail.com"},{"name":"dignifiedquire","email":"dignifiedquire@gmail.com"}],"_npmUser":{"name":"dignifiedquire","email":"dignifiedquire@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/borc_2.1.2_1585245208473_0.958035217596044"},"_hasShrinkwrap":false,"readme":"# borc\n\n[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io)\n[![](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](http://ipfs.io/)\n[![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs)\n[![Coverage Status](https://coveralls.io/repos/github/dignifiedquire/borc/badge.svg?branch=master)](https://coveralls.io/github/dignifiedquire/borc?branch=master)\n[![Dependency Status](https://david-dm.org/dignifiedquire/borc.svg?style=flat-square)](https://david-dm.org/dignifiedquire/borc)\n[![Travis CI](https://travis-ci.org/dignifiedquire/borc.svg?branch=master)](https://travis-ci.org/dignifiedquire/borc)\n\n\n> Assimilate all your JavaScript objects into the Concise Binary Object Representation (CBOR) data format ([RFC7049](http://tools.ietf.org/html/rfc7049)) **as fast as possible**.\n\n\n## About\n\nThis library is a fork of the awesome [node-cbor](https://github.com/hildjj/node-cbor). It borrows a lot of the interface, but drops all streaming and async processing in favor of a minimal syn api and being as fast as possible.\n\n\n## Installation\n\n```bash\n$ npm install --save borc\n```\n\n## Benchmarks\n\nTODO\n\n## Example\n\n```javascript\nconst cbor = require('borc')\nconst assert = require('assert')\n\nconst encoded = cbor.encode(true) // returns <Buffer f5>\nconst decoded = cbor.decodeFirst(encoded)\n// decoded is the unpacked object\nassert.ok(decoded === true)\n\n// Use integers as keys\nvar m = new Map()\nm.set(1, 2)\nencoded = cbor.encode(m) // <Buffer a1 01 02>\n```\n\n## API\n\nSee https://dignifiedquire.github.io/borc for details\n\nThe sync encoding and decoding are exported as a\n[leveldb encoding](https://github.com/Level/levelup#custom_encodings), as\n`cbor.leveldb`.\n\n## Supported types\n\nThe following types are supported for encoding:\n\n* boolean\n* number (including -0, NaN, and ±Infinity)\n* string\n* Array, Set (encoded as Array)\n* Object (including null), Map\n* undefined\n* Buffer\n* Date,\n* RegExp\n* url.URL\n* [bignumber](https://github.com/MikeMcl/bignumber.js)\n\nDecoding supports the above types, including the following CBOR tag numbers:\n\n| Tag | Generated Type |\n|-----|----------------|\n| 0   | Date           |\n| 1   | Date           |\n| 2   | bignumber      |\n| 3   | bignumber      |\n| 4   | bignumber      |\n| 5   | bignumber      |\n| 32  | url.URL        |\n| 35  | RegExp         |\n\n\n## Customizations\n\nBorc supports custom tags as well as custom input types.\n\n### Encode Custom Types\n\n```js\nclass MyType {\n  constructor (val) {\n    this.val = val\n  }\n\n  // Gets called when encoding this object\n  // gen - instance of the encoder\n  // obj - the object being encoded\n  //\n  // should return true on success and false otherwise\n  encodeCBOR (gen) {\n    return gen.pushAny('mytype:' + this.val)\n  }\n}\n\ncbor.encode([new MyType('hello')])\n```\n\n### Encode Custom Tags\n\n```js\ncbor.encode([new cbor.Tagged(42, 'hello')])\n```\n\n### Decode Custom Tags\n\n```js\nconst decoder = new cbor.Decoder({\n  tags: {\n    42: (val) => val + ' world'\n  }\n})\n```\n\n## License\n\nMIT\n","publish_time":1585245208837,"_cnpm_publish_time":1585245208837,"dist-tags":{"latest":"3.0.0"}}