{"name":"@ipld/codec-interface","version":"1.0.8","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":"10fb09fad1ba1c98677b01208bef7b4916450a94","_id":"@ipld/codec-interface@1.0.8","_nodeVersion":"10.18.1","_npmVersion":"6.13.4","dist":{"integrity":"sha512-qidYsyxc2miM4auojdwQhAdqYucjiz0IsoklCRXv0lnl625YvkVBSCeKrrpivQX4R0jZEM34V5qnvzRMksO+Fg==","shasum":"4806331daa07c66150a17ee346181be491a8a16f","tarball":"http://registry-npm.ywwl.com/@ipld/codec-interface/download/@ipld/codec-interface-1.0.8.tgz","fileCount":6,"unpackedSize":8759,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeIhtdCRA9TVsSAnZWagAA6ngP/R7F5G1TsMxHGsUNjVDC\nkftNkPwz3R0nv6hJklYiYW/cfk1TfeMeJyH4eiyYSQKWO36QUkT1/wvTh9pm\nfBNwoPOrCx1gveGAThdtUBIiu9GmseiIY0lYh84tKY7CmVBeQUsCVnIRCQ8s\nY7asjbIhKm1Y3mXZx0DMqOFnvJHWVHqxvJFJ6zsza4ZqTe7wUmlTwhq+REYs\nGu5pY86KTxKKCxGOAtT8cqNhSA12PsHFAwPAlSvT7MeEEJ1FnBdTlgkLXiFk\nMkopR9m1M/31E+KEeJ4jBGDcWHUl9Zpw0wyCC21dAcbaT5kGVgm3imUP5Z0x\njQPrOFVb98qvr9uS+NrXXaNOC9uTwP7IKMZTkDEkmOHLvDeCmOHLPORqjI92\nyRMq0W2E0T7f1owH5MtmP1Nbrs489mt8RXc0yF1VRHkiNJJcbDWLNiQ1Dppk\nuQcVxPWQjIs+Ar195eN7QERrk5N0cBCnhPSCOrn7O4tSXwV1skpzbY8yDPXV\ndaxOTjsGJYslgIS/5X9r+f+jGaaaZjiSVcpLUhlZ5KFFtB1Fr9y3dorffQM9\n2IymMdOimbRpEpNxbpH4zlFrbvZ/5YN+lH2x13yVrScO70jjjbMKbuIcUE4w\nnJtNbPZ5P1RpOV1v6+qMwtlzOOBwNMtmiILV/++Rv8zIoRBb+LJ3AUBVf4SR\nWRXg\r\n=HSuQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIECOjWaMbsFdVe31xf8I3LBMVBm3YQG53UI5E9sF9rtCAiEAyrpA6FD2KanKdhD+TqpZWzMEFOlCO0Xy4xGR9XRj/74="}],"size":3167,"noattachment":false,"key":"/@ipld/codec-interface/-/@ipld/codec-interface-1.0.8.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.8_1579293533059_0.6127060034105849"},"_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":1579293533175,"_cnpm_publish_time":1579293533175,"dist-tags":{"latest":"1.0.14"}}