{"name":"ipld-dag-cbor","version":"0.12.0","description":"JavaScript implementation of the IPLD (InterpPlanetary Linked Data)","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"],"author":{"name":"David Dias","email":"daviddias@ipfs.io"},"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.4.7","traverse":"^0.6.6"},"devDependencies":{"aegir":"^12.4.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":"5c783f6b8e4fc4358748e3bc44d570e8c2b998c7","_id":"ipld-dag-cbor@0.12.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.3","_npmUser":{"name":"vmx","email":"volker.mische@gmail.com"},"dist":{"integrity":"sha512-zitoqSGNP/73r5LU4ZuYE5E+zJar84k+AEGdFl3Y+H3opBn8KTMcR3bm1CoTaJYBfpn1fJpB0jb2wTEQDRESpQ==","shasum":"aea01be0d72dfc93004cfa537a75f163439906b6","tarball":"http://registry-npm.ywwl.com/ipld-dag-cbor/download/ipld-dag-cbor-0.12.0.tgz","fileCount":15,"unpackedSize":1223379,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDSg7wKMfxrWz8x8Tg4aWgpKJLEgqMSWxQ2eNPmhliy3wIgAYTCxaQz5UlEjSlehayTnJWjAyeASfcMugkmBY/hb44="}],"size":280915,"noattachment":false,"key":"/ipld-dag-cbor/-/ipld-dag-cbor-0.12.0.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.0_1518449844968_0.992224522780883"},"_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":1518449846044,"_cnpm_publish_time":1518449846044,"dist-tags":{"latest":"1.0.1"}}