{"name":"@ipld/codec-interface","version":"1.0.10","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.10","_nodeVersion":"12.18.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-FTm1ADaYIJCWz6KQkpyj/ktmPdJX1rYFDvo6QkI18vfgs3aqPfFDTxG6X3HRxqittxcVTYZK9mxNXsjz+hQxPg==","shasum":"d15576975df114b8235cef74745570d9b70fa4cb","tarball":"http://registry-npm.ywwl.com/@ipld/codec-interface/download/@ipld/codec-interface-1.0.10.tgz","fileCount":8,"unpackedSize":10771,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe67HKCRA9TVsSAnZWagAAQzAQAIXj24yEV2ob/sTk0Zye\nvnOJkix+BdFgnzkITrgvs8Mzqk9kQrTOk4k6nzdvgNHJ/8RN+3RSWwSa9QuV\nbcKKeVn6WzcSOe+sYZVESUOi2FNs5hJvV203r3vM9qbGYEXdB2GHGuK5tb8z\nJyxCD/TOuNISNLULbqwBhuVjNQyKdS9CItG7ROesuVwjiqi/JH4zHJnUSeFW\nwb+sCgPWyvc7vNawfrPxUVx+gbAfZ+xpgjXkKOqC6GUktQrVlAopH8/U8Cpe\nfDbu557FuWG6s8OePAtmyMt4HLt0pxnDood+t/X5PRwDmtAlTN4TnrihFur5\nyV+0C9CICrqOkvAkz4+wbDNgy9VL5lkKSbnq7xzFcCr49KDtoMqb4G4rs1m2\ngVY6hkR4cjG1sG1vQ472IdiAdIlbSbI+xLifyhvCPnmND77GQAPlBq06T6e3\nI/cfJBpuPVXH6dFWNQno9BUHssE1JaAIt19B9XiGlexAqPulk8Mshm1ravpo\n3yzvUtYk7G9UFT9lVHEIqNifNBRjmBUt3NIaJ3TQ0qDrhTMOKXdG/ntELuKd\n1JbisZ7JS/DwioXaxuLIs0JbK05269C2bdY8CazCfrXGTbJNIFWpuFLS2Ea+\n1JKi26IrmtqWY2Or+kBc42cUrx9Z5pLh+hf/Bw9ebt2Ucz3itucih2JwSdKF\nMiy1\r\n=tCU6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEE4iXNIZ+PO8bqXrJ5iYJFXZOSkrX3fXFaI59PLMsCXAiEApeJPszeXEMXOVpI3S/DRcS3lCIygvyROWBm1sOJahgA="}],"size":3659,"noattachment":false,"key":"/@ipld/codec-interface/-/@ipld/codec-interface-1.0.10.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.10_1592504777656_0.8375613203860761"},"_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":1592504777757,"_cnpm_publish_time":1592504777757,"dist-tags":{"latest":"1.0.14"}}