{"name":"ipld-dag-cbor","version":"0.12.1","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":{"async":"^2.6.0","borc":"^2.0.2","bs58":"^4.0.1","cids":"~0.5.2","is-circular":"^1.0.1","multihashes":"~0.4.12","multihashing-async":"~0.5.1","traverse":"~0.6.6"},"devDependencies":{"aegir":"^14.0.0","chai":"^4.1.2","deep-freeze":"0.0.1","dirty-chai":"^2.0.1","garbage":"0.0.0"},"contributors":[{"name":"David Dias","email":"daviddias.p@gmail.com"},{"name":"Friedel Ziegelmayer","email":"dignifiedquire@gmail.com"},{"name":"Richard Littauer","email":"richard.littauer@gmail.com"},{"name":"Richard Schneider","email":"makaretu@gmail.com"},{"name":"Volker Mische","email":"volker.mische@gmail.com"},{"name":"Yusef Napora","email":"yusef@napora.org"},{"name":"greenkeeper[bot]","email":"greenkeeper[bot]@users.noreply.github.com"},{"name":"npmcdn-to-unpkg-bot","email":"npmcdn-to-unpkg-bot@users.noreply.github.com"},{"name":"wanderer","email":"mjbecze@gmail.com"},{"name":"ᴠɪᴄᴛᴏʀ ʙᴊᴇʟᴋʜᴏʟᴍ","email":"victorbjelkholm@gmail.com"}],"gitHead":"22a28c7d4fc19df29f2ae8e850f6d5f89d07c036","_id":"ipld-dag-cbor@0.12.1","_npmVersion":"6.1.0","_nodeVersion":"8.11.1","_npmUser":{"name":"vmx","email":"volker.mische@gmail.com"},"dist":{"integrity":"sha512-m0BR/zR9sKIuY/PydppkpwO0S9w7+ob0as7RN3jQmMIpW9m8HW7hLznvtp1xpYZknH7efUhIaMHgaQP43E5IWQ==","shasum":"1f88a9e36f2d842566b4767fc1132667a0ac121e","tarball":"http://registry-npm.ywwl.com/ipld-dag-cbor/download/ipld-dag-cbor-0.12.1.tgz","fileCount":15,"unpackedSize":1169169,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbNiBLCRA9TVsSAnZWagAAkeIP/2d5Lg5QSof5lSs2uDua\nCUP3I3tKuvuip9nxU1Svg88hzZ//LIUHPfBDKdnPcJchn29ptYYOJPZONny4\nT2YQqpG4TWlcd56kIezR7vJ8HhUPheQOgL8MRVeRqUsisAZJY6OW26Tq96Jl\nvv3Mh5Qrzy4/vbVNalCXabK2QASN34wolIq/zc5j0jqXLUJYevNp7pOYohkW\nvXpeKrDIj1LSopiR5trjL3ZOJwsUnRDLgR0qTYaoh0BjvvAddll9imLWSfvF\ns3bEsrkIYjPTYIArjJ3IFuD6ugTY66/gH6UWwaDV0DBeKKx55MkKZteslqO/\n4AlVMB8aRk5Ty9xPUuU7J/fY50RfVVTom4G06kIGyWcuQ/elfPPYBqM6PPFW\n0yM6wnO1Vf1h36nh2GFxAn0b65Y0Ol1HHcoZ7YxP44m5LnZMAucOCPqcAVJ4\nqUYBh4Ii2OlEUV+LjxiotiMexRyPSuvWCFK/cQOQDFt0PMiOjbnCc4FFHZjl\nOzUZuUOP4LG8YQvMLiBxAsqcrVwLGhHE3aIMMrwfkf3OCOFP+kpxnXf0gl9i\n0o5VW1Gr2rzukmLYMXSfUlPW4i6MYS1RpyOUcVFzNZRllE4g+7OgGk8j9NT9\nmy1Yln87aaDQNlu3qCAqxuPS29kzC1Zy7u3c4pTAiFMZISulChaaS2zeqMj2\ny53y\r\n=OaSZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHy7eRlduyxC/Sd0/VcVFBs+GBXYjBrtXSjOWMfDOV4AAiEAg7aMR8wmkAOJaBHJvWVUoQQK53MGwF90dA7Knz8B3QI="}],"size":276640,"noattachment":false,"key":"/ipld-dag-cbor/-/ipld-dag-cbor-0.12.1.tgz"},"maintainers":[{"name":"daviddias","email":"daviddias.p@gmail.com"},{"name":"vmx","email":"volker.mische@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ipld-dag-cbor_0.12.1_1530273867086_0.319278260379559"},"_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":1530273867254,"_cnpm_publish_time":1530273867254,"dist-tags":{"latest":"1.0.1"}}