{"name":"borc","version":"2.0.4","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":"^13.0.6","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":"^7.2.1","commander":"^2.15.0","ieee754":"^1.1.8","json-text-sequence":"^0.1"},"engines":{"node":">=4"},"contributors":[{"name":"Benjamin Cabé","email":"kartben@gmail.com"},{"name":"Dan Finlay","email":"542863+danfinlay@users.noreply.github.com"},{"name":"Joe Hildebrand","email":"joe-github@cursive.net"},{"name":"Joe Hildebrand","email":"joe+github@cursive.net"},{"name":"Patrick Gansterer","email":"paroga@paroga.com"},{"name":"Ryan Pendergast","email":"ryan.pendergast@gmail.com"},{"name":"Rüdiger Klaehn","email":"rklaehn@gmail.com"},{"name":"Scorpi","email":"cobblebone@gmail.com"},{"name":"Tobias Wich","email":"tobias.wich@ecsec.de"},{"name":"dignifiedquire","email":"dignifiedquire@gmail.com"},{"name":"greenkeeperio-bot","email":"support@greenkeeper.io"}],"gitHead":"91149e25f61af2d3b01cc9577d41cb7b3bbd7b1d","bugs":{"url":"https://github.com/dignifiedquire/borc/issues"},"_id":"borc@2.0.4","_npmVersion":"6.4.1","_nodeVersion":"10.11.0","_npmUser":{"name":"dignifiedquire","email":"dignifiedquire@gmail.com"},"dist":{"integrity":"sha512-SCVjto/dbKfduyl+LDQ1Km28ly2aTIXtJbrYZWHFQAxkHph96I/zXTrTQXWuJobG8lQZjIA/dw9z7hmJHJhjMg==","shasum":"52926dc561137188c6ca9fe01c9542576529a689","tarball":"http://registry-npm.ywwl.com/borc/download/borc-2.0.4.tgz","fileCount":31,"unpackedSize":1141855,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbyIhNCRA9TVsSAnZWagAAFHQP/16sDuV+rZzVsY27NYW5\n6h3/TSKduw9NLvndihHkqXZfdZ4R2OZePI7SkbtnnPVhhhGDqofqJwqGkLyR\n3T5xad5+aHqhOr8BBjYBbjLld+mZ5BPZN6JDcf9YPGW5gcyZ249nbb3VrcBo\nhgSKP0XrwBWr0hzA2JV2Afw2mvgA5JONMbzQ3IwiD8o2ZWT6lblHz/Z7wbYP\nzO1BadH3UjIeS063R3wCdB0xVR1CYU+lH4GV3G1gMdRGHERv4TGVyX2ziHcH\nHBs6B1ru2udwGGhJeLw0GCpuecDkvMrrp5Ohp0Lheejzzg9q1iuum4BUvDMg\niA6GJRF4amSBdgbHvtYK/s54H6gUCMfne/Pv+kdcavja4w+vymVWfjSx1zMr\n/IbnT5FD1QX52xjxy6rQ2hhDIIWcRF5xOrfKK9J/f8fTz98oVJLk8112q7L6\nDuRAKA7NB6yVv7P5yu7GyXQgLZbpDqozXGNDtLPqTVT5Wtl/aultVQNvaK5Y\nEQb+TIBw2t1fWdlLmxrgBrpBLqge9S+XMnKC8v5eX29e/hOaIW/EIafGonBp\nbnLp9b6VEHsAvMksVqwvt6K+a9reLvnedAIQJXF1jemNeRVGRbA4TEi6mQbb\nMdei6YfySlavN8mhBnR9h18pkI/dW2p+Nuy7k4f0v+a+jc/Tac7rMNhIIomR\nMvJb\r\n=LS2p\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICieSYlAa4TNn31XoDydGXQhsF37DfRtetO7OnCVhfC0AiBxcVGOoEGgIy8RXGdhJV7h8fMqWd2oc/eRKfitwAfa0Q=="}],"size":323908,"noattachment":false,"key":"/borc/-/borc-2.0.4.tgz"},"maintainers":[{"name":"daviddias","email":"daviddias.p@gmail.com"},{"name":"dignifiedquire","email":"dignifiedquire@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/borc_2.0.4_1539868748539_0.31532124701587194"},"_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":1539868748794,"_cnpm_publish_time":1539868748794,"dist-tags":{"latest":"3.0.0"}}