{"name":"@ipld/codec-interface","version":"1.0.6","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":"027da91541d9d0b116c21eabc1064263ae11002f","_id":"@ipld/codec-interface@1.0.6","_nodeVersion":"10.16.2","_npmVersion":"6.9.0","dist":{"integrity":"sha512-9F0dfRbPbHhh82Q0tGDJ3BVeofiFzpAVfTWjMt36+/rD39kEx5VZkvTz8zPntXO4xQoQpOZbXRvk3i5eVDbwZw==","shasum":"d177e7ca107b92d44c92022ff5d84ec8485b511b","tarball":"http://registry-npm.ywwl.com/@ipld/codec-interface/download/@ipld/codec-interface-1.0.6.tgz","fileCount":6,"unpackedSize":8487,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdVGIMCRA9TVsSAnZWagAAIhMP/AyfZVemOLDUOjoZgjpo\nUwy+jL72/U5s0PB5tnLEbWlZYFtJevsKoVQHWiRbbQmbw3bMsBKXC+dgqH/j\nLK44yv4jOdIg4KkI/0kjNh47PvN5eZ+/TY9QOJ//nWtVUCuZlWM3bgpPpvrs\nzSPsT+SxBJyfCNrYrC9SzxItxUZnlTwnwkikJMkByMDdnaTUL+xudpXyUOLo\nrG0cAN6QBSJf9vNQbWYQr2hVGiioOYnfrzWBEmzCLbPIDqcZNzfyN8FpxLWy\ntUOHe32AopHV/fzb/dJ+rpaxMgsROCQRv8O9xahE7zEOiEOYc6RzP374WfZE\nA03lFO/U8t8yrBPw2+xOjTeOgn8tNetbRqBwqSZPS1LYEfYWwI1yBCLNnVpy\nvzcqAf9fJnAkbVBSPt4JsZWRzJIb33Y/+Ks3L3DXHKgMo4DSI4jLtVK/xwcg\nCofWKD4W3Oh2dM665d2uBoEz3g+zF1+sXJnjGlnQD5DjapiqCD8Azgt/uMNg\nFLcIDwoJQAjAvYN1IE7IPM2Jvw1jGzLFlcTXHyzXQdVeOZljVLwZa7EQ5lCa\nYDkM2NR6Ct7HIVeomMOHx3Xa1Fqb+yLef53/pW4bUvV/7FwbeZUBiZ6ldq6P\nP3RuP/qNR2GZL0S2R88u2RObOA49/nW/tZPRCckO6MeUR4ZQUZtHOYkL/4H2\n7jBT\r\n=TVQK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDXtJBUN4X3giCPu/hogE0P/aGEM5/pVd4F0SYSVNtGSAIgBULf9txV05Tqf4+xxe8k+7Xq+zKGkICVHpctqjRHNPY="}],"size":3082,"noattachment":false,"key":"/@ipld/codec-interface/-/@ipld/codec-interface-1.0.6.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.6_1565811211204_0.4905902948365686"},"_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":1565811211371,"_cnpm_publish_time":1565811211371,"dist-tags":{"latest":"1.0.14"}}