{"name":"@ipld/codec-interface","version":"1.0.2","description":"``` npm install @ipld/codec-interface ```","main":"index.js","directories":{"test":"test"},"scripts":{"test":"nyc --branches 100 --functions 100 --lines 100 aegir test -t node","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-ipld-codec-interface.git"},"bugs":{"url":"https://github.com/ipld/js-ipld-codec-interface/issues"},"homepage":"https://github.com/ipld/js-ipld-codec-interface#readme","gitHead":"f34f57890093a793a1cf669299bad9597e1be44d","_id":"@ipld/codec-interface@1.0.2","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"mikeal","email":"mikeal.rogers@gmail.com"},"dist":{"integrity":"sha512-978+7EV6s0XV0gBbN2EmnNSHBKjiJgM7BclQ69oAeRbRqNFjjW3G0s9oPG7Ko3/ZZJFqC/9ydOn0fCJ3poAIyw==","shasum":"1eb558b20f9f1af0adc64b6a85760cb3d88cf2f2","tarball":"http://registry-npm.ywwl.com/@ipld/codec-interface/download/@ipld/codec-interface-1.0.2.tgz","fileCount":6,"unpackedSize":7928,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJczLS6CRA9TVsSAnZWagAABQsP/3uW0hli3VHUhmY1dNu+\nSQVFzeH3yK7Q4opk66NGmyC0oDjRoSsGVK61Frg8O3xi10zhTOPgHPrQIWYr\nb5Cbg9GN5LnPrpIu5eC1UGL2xZDBlYgDDkLm3tf2pEgw6NKi6rPdyeTR6fCb\nwIavzdKJs+px5X38hHsLiJmiSc2mzK4DRlo6ysI1yYQWMEoOOPJy5+qPTBjB\noH+rnMkzcUX07/rxLzETMbHeKC393Ktxan3TTyuhfuEw6dL3Vk+Ie5MTG5HO\nANM6Wzq1eHlX1TmzwOKNjl7Qg232GCRk23869Q1xk3xrX1htx+Aa6Hk+5iCS\nIdT/djhP1H9J/jY+EeUhfsefFNQoV6RtxVkn9N3L/W+Nc7JJ1GhjfrH8IpLd\ndMM+lq1OQxcwHYC3ARZ+Sf0EQlGCmobGYuXmFrT/lOzMwIGNdPamGb5gCM/V\n6cfMBFMsHOYwkbqumqJG6X1w7yon5e66pA7YFCUl7TZ6fwST/8KjVAcKkojc\nCv+hHRQXMf9LFHkLk/zqrxACPha9B1z/9HRiEfoqQ8+rWPHNnvkWHXyygmw+\nqLnVbLAr4ZNJuSXfja7F0SbyLB7zQqFO12aFZYInKdRFpM8Nt9ncmjXnT2iG\niiDAzX2KKnYGVJjAArFUOjxHBUHr6asUtDf3hUQ2L+oor6t1kOUbiIuXp+34\nBchX\r\n=rt93\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICK8YNGZYpYUZalahvsiDuQt6c2u+9XnPW81ZgZR+zSAAiEAxJg6Pgqxs5dujNRe1DuFi3w8JIueTlPiowUZ9Iq4EsY="}],"size":2898,"noattachment":false,"key":"/@ipld/codec-interface/-/@ipld/codec-interface-1.0.2.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.2_1556919481874_0.8154807617004463"},"_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":1556919481990,"_cnpm_publish_time":1556919481990,"dist-tags":{"latest":"1.0.14"}}