{"name":"ipld-dag-cbor","version":"0.16.0","description":"JavaScript implementation of the IPLD (InterpPlanetary Linked Data)","leadMaintainer":"Volker Mische <volker.mische@gmail.com>","main":"src/index.js","scripts":{"test":"aegir test","test:browser":"aegir test --target browser","test:node":"aegir test --target node","lint":"aegir lint","release":"aegir release","release-minor":"aegir release --type minor","release-major":"aegir release --type major","build":"aegir build","coverage":"aegir coverage","coverage-publish":"aegir coverage publish"},"pre-push":["lint","test"],"repository":{"type":"git","url":"git+https://github.com/ipld/js-ipld-dag-cbor.git"},"keywords":["IPFS"],"license":"MIT","bugs":{"url":"https://github.com/ipld/js-ipld-dag-cbor/issues"},"engines":{"node":">=6.0.0","npm":">=3.0.0"},"homepage":"https://github.com/ipld/js-ipld-dag-cbor","dependencies":{"borc":"^2.1.2","buffer":"^5.6.0","cids":"~0.8.3","is-circular":"^1.0.2","multicodec":"^1.0.3","multihashing-async":"^1.0.0"},"devDependencies":{"aegir":"^25.0.0","chai":"^4.2.0","detect-node":"^2.0.4","dirty-chai":"^2.0.1","garbage":"0.0.0","multihashes":"^1.0.1"},"contributors":[{"name":"David Dias","email":"daviddias.p@gmail.com"},{"name":"Volker Mische","email":"volker.mische@gmail.com"},{"name":"dignifiedquire","email":"dignifiedquire@gmail.com"},{"name":"Richard Schneider","email":"makaretu@gmail.com"},{"name":"wanderer","email":"mjbecze@gmail.com"},{"name":"Rod Vagg","email":"rod@vagg.org"},{"name":"Linus Unnebäck","email":"linus@folkdatorn.se"},{"name":"Richard Littauer","email":"richard.littauer@gmail.com"},{"name":"Alan Shaw","email":"alan.shaw@protocol.ai"},{"name":"Hugo Dias","email":"hugomrdias@gmail.com"},{"name":"Brandon Westcott","email":"brandonwestcott@gmail.com"},{"name":"Irakli Gozalishvili","email":"contact@gozala.io"},{"name":"Joel Gustafson","email":"joelg@mit.edu"},{"name":"Jonah Weissman","email":"jonahrweissman@gmail.com"},{"name":"Mikeal Rogers","email":"mikeal.rogers@gmail.com"},{"name":"Yusef Napora","email":"yusef@napora.org"},{"name":"ᴠɪᴄᴛᴏʀ ʙᴊᴇʟᴋʜᴏʟᴍ","email":"victorbjelkholm@gmail.com"}],"gitHead":"4646b62b0309116dbe6d8bfc3de92dd4653ce64b","_id":"ipld-dag-cbor@0.16.0","_nodeVersion":"14.4.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-dnmR8Pgt1gGmEXWSf/V3dKDPveGnHsovvAAN7m/WHW5mXsBqYYOStt98K1RhCifbB7vY+IHmpdRhVka0g9DWFQ==","shasum":"2f2b54ba46dc64a7cfce107cee7b9b2114034b98","tarball":"http://registry-npm.ywwl.com/ipld-dag-cbor/download/ipld-dag-cbor-0.16.0.tgz","fileCount":35,"unpackedSize":1734300,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfCHI8CRA9TVsSAnZWagAACAEP/28sicvcKISnkxJfxfZo\n1Uj4nLan11KlGOLU186WuyO+Nv0HEB2ZJwz2QgixiHOkbnw7+P0awSNd53fv\nX9V/lmN6iKOybYu+dWaK5iRzyzN61DvE7KlTcdw7QhCUVqSmeKkCHRIWEENB\nNGyam8ur16jaj0JJf67wYP8DUcl5fbaRV7WdfHcdr//qeBCe75IKiJHeDIMM\nIquX3RVV/k9ekecMHZxZHxeFRab6r2q7liF0W0pPuc6BPH3ijrrU4mj7jLRF\noGPDrlfHZY4WjKVKAcR0WxgmpgHjC/u43oSwzjT5sFmQlKPahjmpM87qr3B2\nUCtC3gemU8BEwn1T1t/GYA5nnIJd7di+l7uIJnT3kNu0Pr47wskFo9ae/nOO\na5T2pmqHE2kGkazI+U2texJ2FJvH3SGFFH9UJO594beMojzmMeOgII6HDiGc\n/R0HDn2JO11qbJ+lbbaQYU0L96g0uc1myynNiWIn31utnxu+FJ7aqhrHJh3l\nbcKSnqboJY7m+PbBsW/dlzaVKkvzZVjY8zXUq93pdoBWqI/YRUD58A6BnwW2\niiaXjpXGb9HyA0ZHMGuVWNXzgmwTfSurc94RBpBdBF1SyeO6woTU82/OeJiv\nZ/jhgJKGiQ2NvtmI0Rg4Jb3P7UupHgUYiuXU+o3gZTeaUYaeq2t1HcO+lo5o\n7hji\r\n=t8RR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD4/BeaUaXwPnl85EWxG1l3+sv/t/FIgxMHBD2DgNG95gIgESBtDX86p8lybKmeG23ac/yu90jWAMBNt7gUEOh5RwM="}],"size":1267997,"noattachment":false,"key":"/ipld-dag-cbor/-/ipld-dag-cbor-0.16.0.tgz"},"maintainers":[{"name":"daviddias","email":"daviddias.p@gmail.com"},{"name":"vmx","email":"volker.mische@gmail.com"}],"_npmUser":{"name":"vmx","email":"volker.mische@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ipld-dag-cbor_0.16.0_1594389051431_0.39933316366550775"},"_hasShrinkwrap":false,"deprecated":"This module has been superseded by @ipld/dag-cbor and multiformats","readme":"⛔️ DEPRECATED: This module has been superseded by [@ipld/dag-cbor](https://github.com/ipld/js-dag-cbor) and [multiformats](https://github.com/multiformats/js-multiformats) <!-- omit in toc -->\n======\n\n# js-ipld-dag-cbor <!-- omit in toc -->\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-IPLD-blue.svg?style=flat-square)](http://github.com/ipld/ipld)\n[![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs)\n[![Travis CI](https://flat.badgen.net/travis/ipld/js-ipld-dag-cbor)](https://travis-ci.com/ipld/js-ipld-dag-cbor)\n[![Coverage](https://coveralls.io/repos/github/ipld/js-ipld-dag-cbor/badge.svg?branch=master)](https://coveralls.io/github/ipld/js-ipld-dag-cbor?branch=master)\n[![](https://img.shields.io/badge/standard--readme-OK-green.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme)\n[![](https://david-dm.org/ipld/js-ipld-dag-cbor.svg?style=flat-square)](https://david-dm.org/ipld/js-ipld-dag-cbor)\n[![](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard)\n[![Greenkeeper badge](https://badges.greenkeeper.io/ipld/js-ipld-dag-cbor.svg)](https://greenkeeper.io/)\n![](https://img.shields.io/badge/npm-%3E%3D3.0.0-orange.svg?style=flat-square)\n![](https://img.shields.io/badge/Node.js-%3E%3D6.0.0-orange.svg?style=flat-square)\n\n> JavaScript implementation of the [IPLD spec](https://github.com/ipfs/specs/tree/master/ipld).\n\n## Lead Maintainer <!-- omit in toc -->\n\n[Volker Mische](https://github.com/vmx)\n\n## Table of Contents <!-- omit in toc -->\n\n- [Install](#install)\n  - [npm](#npm)\n  - [Use in Node.js](#use-in-nodejs)\n  - [Use in a browser with browserify, webpack or any other bundler](#use-in-a-browser-with-browserify-webpack-or-any-other-bundler)\n  - [Use in a browser Using a script tag](#use-in-a-browser-using-a-script-tag)\n- [Usage](#usage)\n- [API](#api)\n  - [`dagCBOR.util.serialize(obj)`](#dagcborutilserializeobj)\n  - [`dagCBOR.util.deserialize(serialized)`](#dagcborutildeserializeserialized)\n  - [`dagCBOR.util.configureDecoder([options])`](#dagcborutilconfiguredecoderoptions)\n  - [`dagCBOR.util.cid(obj[, options,])`](#dagcborutilcidobj-options)\n- [Contribute](#contribute)\n- [License](#license)\n\n## Install\n\n### npm\n\n```sh\n> npm install ipld-dag-cbor\n```\n\n### Use in Node.js\n\n```JavaScript\nconst dagCBOR = require('ipld-dag-cbor')\n```\n\n### Use in a browser with browserify, webpack or any other bundler\n\nThe code published to npm that gets loaded on require is in fact a ES5 transpiled version with the right shims added. This means that you can require it and use with your favourite bundler without having to adjust asset management process.\n\n```JavaScript\nvar dagCBOR = require('ipld-dag-cbor')\n```\n\n### Use in a browser Using a script tag\n\nLoading this module through a script tag will make the `IpldDagCbor` obj available in the global namespace.\n\n```html\n<script src=\"https://unpkg.com/ipld-dag-cbor/dist/index.min.js\"></script>\n<!-- OR -->\n<script src=\"https://unpkg.com/ipld-dag-cbor/dist/index.js\"></script>\n```\n\n## Usage\n\n```JavaScript\nconst dagCBOR = require('ipld-dag-cbor')\n\nconst file = {\n  name: 'hello.txt',\n  size: 11\n}\n\nconst serialized = dagCBOR.util.serialize(file)\nconsole.log(`Encoded as a ${serialized.length} byte Uint8Array`)\n\nconst node = dagCBOR.util.deserialize(serialized)\nconsole.log('Decoded as:', node)\nrequire('assert').deepEqual(node, file) // should match\n\n// → Encoded as a 22 byte Uint8Array\n// → Decoded as: { name: 'hello.txt', size: 11 }\n```\n\n## API\n\n### `dagCBOR.util.serialize(obj)`\n\nEncodes an object into IPLD CBOR form, replacing any CIDs found within the object to CBOR tags (with an id of `42`).\n\n - `obj` (any): any object able to be serialized as CBOR\n\nReturns the serialized node.\n\n### `dagCBOR.util.deserialize(serialized)`\n\n Decodes an IPLD CBOR encoded representation, restoring any CBOR tags (id `42`) to CIDs.\n\n  - `serialized` (`Uint8Array` or `String`): a binary blob representing an IPLD CBOR encoded object.\n\nReturns the deserialized object.\n\n### `dagCBOR.util.configureDecoder([options])`\n\nConfigure the underlying CBOR decoder.\n\nPossible values in the `options` argument are:\n\n - `size` (`Number`, optional): the current heap size used in CBOR parsing, this may grow automatically as larger blocks are encountered up to `maxSize`. Default: `65536` (64Kb).\n - `maxSize` (`Number`, optional): the maximum size the CBOR parsing heap is allowed to grow to before `dagCBOR.util.deserialize()` returns an error. Default: `67108864` (64Mb).\n - `tags` (`Object`, optional): an object whose keys are CBOR tag numbers and values are transform functions that accept a `value` and return a decoded representation of that `value`.\n\n The CBOR decoder uses a heap size that is a power of two. Setting `size` to a number other than a power of two will result in a heap using the next-largest power of two.\n\n Calling `dagCBOR.util.configureDecoder()` with no arguments will reset to the default decoder `size`, `maxSize` and `tags`.\n\n### `dagCBOR.util.cid(obj[, options,])`\n\nCreate a [CID](https://github.com/multiformats/js-cid) for the given unserialized object.\n\n - `obj` (any): any object able to be serialized as CBOR\n - `options` (`Object`):\n  * `hashAlg` (`String`): a [registered multicodec](https://github.com/multiformats/multicodec/blob/master/table.csv) hash algorithm.\n  * `hashLen` (`String`): an optional hash length\n  * `version` (`Number`): CID version number, defaults to `1`\n\nReturns a Promise with the created CID.\n\n## Contribute\n\nFeel free to join in. All welcome. Open an [issue](https://github.com/ipld/js-ipld-dag-cbor/issues)!\n\nCheck out our [contributing document](https://github.com/ipld/ipld/blob/master/contributing.md) for more information on how we work, and about contributing in general. Please be aware that all interactions related to IPLD are subject to the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md).\n\nSmall note: If editing the README, please conform to the [standard-readme](https://github.com/RichardLitt/standard-readme) specification.\n\n## License\n\n[MIT](LICENSE) © 2015 David Dias\n","publish_time":1594389051607,"_cnpm_publish_time":1594389051607,"dist-tags":{"latest":"1.0.1"}}