{"name":"@ipld/codec-interface","version":"1.0.5","description":"Codec interface for IPLD.","main":"index.js","directories":{"test":"test"},"scripts":{"test":"nyc --check-coverage --branches=100 --functions=100 --lines=100 --statements=100 aegir test","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":"^18.2.2","nyc":"^14.1.0","standard":"^12.0.1","tsame":"^2.0.1"},"dependencies":{"cids":"~0.6.0"},"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":"54865c7b0a0a0a2b93a9a5abb76d5230b7dc9492","_id":"@ipld/codec-interface@1.0.5","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"mikeal","email":"mikeal.rogers@gmail.com"},"dist":{"integrity":"sha512-9bmrEXuBw6JVgQZAsCIzrPuLIDdQ1RHrUyjEEg4zaxbi6c75IInj8/gki2Uyg86bDyRg8azxZh3uEMjYwpxsYQ==","shasum":"7c9751dccd854fc29db6ab1a63a607dfab11c2b1","tarball":"http://registry-npm.ywwl.com/@ipld/codec-interface/download/@ipld/codec-interface-1.0.5.tgz","fileCount":6,"unpackedSize":8369,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc7WL7CRA9TVsSAnZWagAAKgoP/2UZGRdyRAjNW92Z8/Sp\ne+zOAJAr1kalVoR7f++Iq/pqVxGTzumhF/JYTj+k4ZH12ZWKoEPHzQoz2MFH\ni1YOin0mllcd5ORoPI6sOA5/o5nVGMkvoaoACqNjHrnNMxrWh18rBxQNLKgU\n9lLGwns/Nm4h3J4GdH37sy8zNoBfoS+7QfBa8FyMRB5Z+CZEa5c6S0URM8U7\n3T+AVAw35qkAGrbbkE6gE6kgHJp9WKvuhORb8PsJCnPbPbH+Gyquurc6DKDm\nOyQLRWOH7e2ReDmIX1ngiAZe3+OQV9+a5FCSW6wCq3yUHxrqUQvz3xYwYcGU\ndX7//K0sm276Xl/uGb4xhZpgEsUwlk4goWArmEgndigd+MFzPE/83xySPmRz\niSCTvfNgKsQIrhs/hDE1B2R/vbKGY1Ab6AeeefjW0WA5nFRCHm9qvxVnzNqC\n089ZA579ZkJWq/NoJsEEy8Plw3w3ImDgiDwO4aaRbbWrlrIAlLM1ETNu87/p\na/eK7gr/XZhfCgz1E4Z7YOmFDyb+WyGSvIMxfHe0dPPLbday+YK5ib3TSdtC\nqWCc745ZNQtF5ZXWFZlDqKTRpkfubbfmoygYq0zcGqZT7TC+bOTCr0DumTBq\nCG9cIxrRsI3Srtmu+TFMAOWzVRLpSBz9PLQPYB4gTa5BPFAw4YiOLsCayMiL\nTPIx\r\n=skgW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEmNGOC58OiQ51eAxmL07lg/Qv/FYVJkh9Vjwljv2Ef3AiBoR1PJ4iU/MT6rILrIEkEshiDgkEbDXErOuXx4k0vf7g=="}],"size":3040,"noattachment":false,"key":"/@ipld/codec-interface/-/@ipld/codec-interface-1.0.5.tgz"},"maintainers":[{"name":"daviddias","email":"mail@daviddias.me"},{"name":"mikeal","email":"mikeal.rogers@gmail.com"},{"name":"vmx","email":"volker.mische@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codec-interface_1.0.5_1559061242604_0.2964044705132114"},"_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":1559061242826,"_cnpm_publish_time":1559061242826,"dist-tags":{"latest":"1.0.14"}}