{"name":"@ipld/codec-interface","version":"1.0.9","description":"Codec interface for IPLD.","main":"index.js","directories":{"test":"test"},"scripts":{"test":"hundreds aegir test -t node browser","pretest":"aegir lint"},"keywords":[],"author":{"name":"Mikeal Rogers","email":"mikeal.rogers@gmail.com","url":"https://www.mikealrogers.com/"},"license":"(Apache-2.0 AND MIT)","devDependencies":{"aegir":"^20.5.1","hundreds":"0.0.2","tsame":"^2.0.1"},"dependencies":{"cids":"~0.7.2"},"repository":{"type":"git","url":"git+https://github.com/ipld/js-codec-interface.git"},"bugs":{"url":"https://github.com/ipld/js-codec-interface/issues"},"homepage":"https://github.com/ipld/js-codec-interface#readme","gitHead":"f002f9b61d166e7cea565d995e131d9b0217f072","_id":"@ipld/codec-interface@1.0.9","_nodeVersion":"12.18.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-2GA3Ts6v20ibY3PAjE0BXj8hmgl/ySy1UQfD8XqKOgFvfy2HxkzRlQKDEWVPi3Jw8AUIY6BbAgFhvayMzF+x/w==","shasum":"0de158c5029a42f67ac313b33b03bcec37836e7f","tarball":"http://registry-npm.ywwl.com/@ipld/codec-interface/download/@ipld/codec-interface-1.0.9.tgz","fileCount":8,"unpackedSize":10774,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe67G2CRA9TVsSAnZWagAA/A4P/37zVolnrN8ZiHE0VACh\nMNbJMHQ3FkxhiyGPUzo9LgAWnvz8d+hxqTryjNr76Sp+qD6uxx0+6+lIqfC/\nsdmGR0lhAwyppzIkurYoIU2ZlCa+QJzweY324groNWfe3bAJhs1kih8zSR6t\nr3oHcx+EYa9Dw3McBrG07dzwDbTnByGlFe3CuVZddCVmxYDd2UxG2BdUq5Y1\nBKknJcuzkcIJuqiIa5FgjsidUU3xL3ei0acHD2nxvA4HnHBsfDHjKEmpiXOL\nJYCQ9lB5QOPcrN73G1mP5oioutrCy1S2oDA8c8i+oO7lMtvjJdP8xLPy6nTC\na9u3IokSrBdNf7x1SkGpJPmdixtCMfbh/AaMH8iK1wxZ+tG/FAa2CPnO14m+\nK7RJ/L4vnbes9Z7vkI8gP62rIOHAc+tAm94yQN3Wwkk8x72634jt/TlvjVIp\nCd3Glzov9yvFJiDTvaFENTyP6fPM24mr4hMBQuBZAoFZh9YwCFS5oG5TOXON\n7AM52A9l+WH4XqvMUcnvSZ8DhtfFVxdaX+wYdwgRl1Jjnh+oiiboqpRIbBvP\nevfLsujMMtVaSVyKgY5eRyeMy5lRsG5PATLUE3xmw3aGpEyRRQz9PLmeztJ9\nB1SjzQwcIAq0rQOwGpRTAM6PnX0ZcGpiw5frKL2SHP6c0wZ8uInDwZC0JGPH\nivze\r\n=pQN7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGATlBQ0z3yMqCLxhDq+T6rlx/QJAfnHWdp5h3HT2ScSAiEA7MSQr8uXIbwi1koIrbz2+t+iD9klMPAjO67lx30YmF4="}],"size":3652,"noattachment":false,"key":"/@ipld/codec-interface/-/@ipld/codec-interface-1.0.9.tgz"},"maintainers":[{"name":"daviddias","email":"mail@daviddias.me"},{"name":"mikeal","email":"mikeal.rogers@gmail.com"},{"name":"vmx","email":"volker.mische@gmail.com"}],"_npmUser":{"name":"mikeal","email":"mikeal.rogers@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codec-interface_1.0.9_1592504757656_0.17494890119417184"},"_hasShrinkwrap":false,"readme":"# Install\n\n![64385](https://img.shields.io/badge/compiled%20bundle-64k-yellowgreen) ![18795](https://img.shields.io/badge/gzipped%20bundle-19k-yellowgreen)\n\n```\nnpm install @ipld/codec-interface\n```\n\n# Codec Interface\n\nThis is the primary interface for implementing new codecs.\n\nThe interface is quite simple:\n\n```\n{\n  encode: Function,\n  decode: Function,\n  codec: String,\n  reader: Function\n}\n```\n\n## encode & decode\n\nThese are the primary methods you need to implement in order to implement a new codec.\n\nWhile you *can* implement the entire `Reader` interface yourself, you can actually leverage \nour `codec-interface.create` utility to get a full implementation with these methods alone.\n\n* `encode` takes a native JavaScript object and returns a binary encoding.\n* `decode` takes a binary encoding and returns a nativfe JavaScript object.\n\nMethods can be either synchronous or asynchronous (returns a promise).\n\n## reader(block)\n\nThe reader function accepts a `Block` instance and returns a full `Reader` interface.\n\nThis method can be either synchronous or asynchronous (returns a promise).\n\n## `codec-interface.create(encode, decode, codecName)`\n\nReturns a full `Codec Interface` based on your encode and decode implementations.\n\n## Reader()\n\n### Reader.get(path\n\n### Reader.links()\n\nReturns a generator of all the links in the block.\n\n### Reader.tree()\n\n\n","publish_time":1592504757799,"_cnpm_publish_time":1592504757799,"dist-tags":{"latest":"1.0.14"}}