{"name":"@ipld/codec-interface","version":"1.0.0","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.0","_npmVersion":"6.4.1","_nodeVersion":"10.15.1","_npmUser":{"name":"mikeal","email":"mikeal.rogers@gmail.com"},"dist":{"integrity":"sha512-OfusqpTaTRDJpljkLdWIMjg3JRMzbMqAw5SxOxP2VxCE/ivDZ2PuTCdh8r2Gmz6dlyI8oN72r87pqnQgEDwYMw==","shasum":"9782ed8eedca920a4b3e66417e6840738aaf829b","tarball":"http://registry-npm.ywwl.com/@ipld/codec-interface/download/@ipld/codec-interface-1.0.0.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\nwsFcBAEBCAAQBQJczLRaCRA9TVsSAnZWagAA8WoP/1dVIhDVYRpKXyS7Oj3O\nq6f08V9Q9T1Pg7iPh+l85FbO9BE9yc3nMA6VlDpyVmD7osLOJfCTqpfMchq5\nAuV2xfdoe1x1U5fI5ZJveuXWfqcH/mXFPQKJotEFuWBaLfbkEDLDFE3svqEG\nCNzyjKc5UtOxy6yHGE1EfJdUFQ7M736KxNvguiA1LDIVxJ01k6Kw7cFI40W2\naYRDPG345YM4CDymW9baa2UIppNfIud/A3f1/3Jkv6JXLRkTFiIXAQK1qSlm\nZujKaXYPSCQC8/CX5+Z/Az+p6o9J6uLUQJyYKyOalJ4VQPvx4k1VbMQrh+JY\n7vlcJNvsN5GpEaWp9kR2hZbj6BmDaTk9cqrr9XqkDPcw3fXgVZk5Twp2RZsX\nfgZ7OapAG2tEgnxOqzGz8fBksyh0053HEWbp/N8edgt0N/z9f9ClTVQdwwYN\nn+3vZM9/O3nC15AsNTtghGeV55fMAZ3Zduonivqng6hyzaXYcKALdcMxNNVL\nLnuETN8gkOcP0jqSkB+SH1lhG5H6I883pe2Unxu9gxlkIpV+TTppb9/u71Ug\nyiSrxAR1CAdsCN7aohgK0uh0TTIkiCwzP07nv3Sbht4iZaT3eX3DEljZelqJ\nyJygK38POmba/Ez8C4PSmQSQpA4rSPAMGLd8XxZ1ngTSyrGGCG3ZyhvNbUTW\npMai\r\n=FMh8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAI8F6Hxd6lHD8nq9D0gktel7M6m3G0zZWxXBlUr6PkBAiA+JSgd6qaoZCQA5l9ZJ3aJ23g/y7vLWwUcwI4XgJcoqA=="}],"size":2899,"noattachment":false,"key":"/@ipld/codec-interface/-/@ipld/codec-interface-1.0.0.tgz"},"maintainers":[{"name":"vmx","email":"volker.mische@gmail.com"},{"name":"mikeal","email":"mikeal.rogers@gmail.com"},{"name":"daviddias","email":"mail@daviddias.me"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/codec-interface_1.0.0_1556919385985_0.29203286309310683"},"_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":1556919386188,"_cnpm_publish_time":1556919386188,"dist-tags":{"latest":"1.0.14"}}