{"name":"ipld-dag-cbor","version":"0.15.3","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.5.0","cids":"~0.8.0","is-circular":"^1.0.2","multicodec":"^1.0.0","multihashing-async":"~0.8.0"},"devDependencies":{"aegir":"^22.0.0","chai":"^4.2.0","detect-node":"^2.0.4","dirty-chai":"^2.0.1","garbage":"0.0.0","multihashes":"~0.4.14"},"contributors":[{"name":"Alan Shaw","email":"alan.shaw@protocol.ai"},{"name":"Alan Shaw","email":"alan@tableflip.io"},{"name":"Brandon Westcott","email":"brandonwestcott@gmail.com"},{"name":"David Dias","email":"daviddias.p@gmail.com"},{"name":"Friedel Ziegelmayer","email":"dignifiedquire@gmail.com"},{"name":"Hugo Dias","email":"hugomrdias@gmail.com"},{"name":"Hugo Dias","email":"mail@hugodias.me"},{"name":"Irakli Gozalishvili","email":"contact@gozala.io"},{"name":"Joel Gustafson","email":"joelg@mit.edu"},{"name":"Jonah Weissman","email":"jonahrweissman@gmail.com"},{"name":"Linus Unnebäck","email":"linus@folkdatorn.se"},{"name":"Mikeal Rogers","email":"mikeal.rogers@gmail.com"},{"name":"Richard Littauer","email":"richard.littauer@gmail.com"},{"name":"Richard Schneider","email":"makaretu@gmail.com"},{"name":"Rod Vagg","email":"rod@vagg.org"},{"name":"Volker Mische","email":"volker.mische@gmail.com"},{"name":"Yusef Napora","email":"yusef@napora.org"},{"name":"greenkeeper[bot]","email":"23040076+greenkeeper[bot]@users.noreply.github.com"},{"name":"greenkeeper[bot]","email":"greenkeeper[bot]@users.noreply.github.com"},{"name":"naure","email":"naure@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":"242576f616dd3763868f3c6b119a1d266faead79","_id":"ipld-dag-cbor@0.15.3","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-m23nG7ZyoVFnkK55/bLAErc7EfiMgaEQlqHWDTGzPI+O5r6bPfp+qbL5zTVSIT8tpbHmu174dwerVtLoVgeVyA==","shasum":"283afdb81d5b07db8e4fff7a10ef5e517e87f299","tarball":"http://registry-npm.ywwl.com/ipld-dag-cbor/download/ipld-dag-cbor-0.15.3.tgz","fileCount":37,"unpackedSize":3274578,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe4La0CRA9TVsSAnZWagAA1twP/1FEYjEh52LP/40l3r8O\nJ+4fkLBoV6P1bLqBRKG0Taq+zqLlCieGppqTLPVSfsFbzuL8v3sG0N6CKXBa\ngZmaBx43qxltPWcNsEu/SOmCVnmzh8GMM7pQ1OmtDzciODvxi8hJhCmXkMZB\nmn9f0jJE9jayvdYVtS3yO22qlmqRjuXDpkJLiomubmNThOEG5FJG/HwgfvYw\nya5LD47X+T36gUQ4iSm7pT0KCqOEq6gcLsizszj+WC5q1IalVluocAoDPUiN\nGw0/iLoE3eOS2JkOQCAYGtyokDeKBfIfGwcGNRfz6giDh3SM2ezkJ9sdL2Wv\nxnb69FApbx5BhyuwWFinsfMRIW/eLKyWAObWCfsm4XFWmRPN6syeYhH1v1zm\n86tlkwpFQ7q0qo6HRN9f36398J0O1zGv0w/mrzYw84SpdEF8LMcQV8FFfnc8\nB4RGkcDe5hTzhTKHBhT32zjI137i5ojC8+Xy3x8mhO94mZJOrVBEMb4eKHVm\n+N29540zBR1yRcqiMbLE42ObP4qMoCmjmd0eY3QkV9s+g7cgEFAf9IPIPFn5\nJNmgl2RXyt60fKTSgi0pnIrPjGpxqODxqzsfXt+PKWCpa4zKKEutxWRUAVNQ\nrD8BEITmQNtAlHw9uqLuCbfE9LNPGhy8FbLdjKNgMqLSO/6PQyxf/zs+7JYh\nnmk/\r\n=u3Q7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICn1ZGycbV9sCm9UNS+yfn2NarNsaLgieXz+VvmOEWUcAiA5rFd1TRyt4HFzmR0uq+4PS2GKiDEZIV+9YDWdajMtrw=="}],"size":1613014,"noattachment":false,"key":"/ipld-dag-cbor/-/ipld-dag-cbor-0.15.3.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.15.3_1591785139503_0.08932330043913095"},"_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":1591785139757,"_cnpm_publish_time":1591785139757,"dist-tags":{"latest":"1.0.1"}}