{"name":"@ipld/codec-interface","version":"1.0.14","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":"^31.0.1","assert":"^2.0.0","buffer":"^6.0.3","hundreds":"0.0.9"},"dependencies":{"cids":"^1.1.6"},"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":"11cdb2a249499af75b76049d5183b9715c6e8c92","_id":"@ipld/codec-interface@1.0.14","_nodeVersion":"12.21.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-YrxABYCJX5m9MeVBhE0MKsOv0+iT05GbeRRd1NpToSBdkM6PyoyXsrSScWqmSLHHYJD5buxkUJ+0qupmXYiu/g==","shasum":"c9d281d75b8195021648c892dc6342457717c8c6","tarball":"http://registry-npm.ywwl.com/@ipld/codec-interface/download/@ipld/codec-interface-1.0.14.tgz","fileCount":6,"unpackedSize":9628,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgP1QyCRA9TVsSAnZWagAAxFUP/RA5ZGIVMHUrDl3VqF7w\nH+wLRuTj2Q2kfM6Fr+hiypqQDaal3RZpPSVRJVTXsXmh4B3H0KxXrslZGfB+\n4GiviL9ckYE/VDYGTOx2Pr5INvapW27MyEutux7A3H4Jwjf7YlwOVmKg1+Q/\nHIfMMDTedgXLiidbW7QxF2yAs5jWq+F65qRRKzwlUONQrEXhFWvmCxaN3Nkv\nLvItpxU7oBFYvmNXfPYy+9S8X/HQgSH3NBveVJJ5tSNm7MK+K/Y2oC5J+tNi\najHasszU70HtQLjpJ2fzEnmxV9Vh+LrcEhtD9bM7X6OB3FLMMYvfrU/Maj28\nWTkc5i0I85n/ngfN4gczKynZYr+ZfpIH3hqNFxDL+W5+yVufKxHs3h2CatsM\nTlG5jdVa0wKLbqFMF2DlbaLLy6tkz9SqUiB8XKVi1qFwzRRaXrNMXzYk5GSu\neVf3mADeEx5BY0pZ6/9Zoh1XpiZXXm9U+M23PaAIh4T+8tcLXyTWGZNkwh8k\n9BWFS7h2H7/0x9HjrOg75fBRqjDC8CtxYsI5f+adrKwnh3HN7zSzRO6eUJU2\nYWCFgVAHCRCTCRGibEeH8LC6aHRPew18cgYgkEeCjrUHmKMsjLsfcRePSwT6\nDjL2zdTCxoDyjJAye2iuNcyhyUrmMGF2NP0o9TI8ZDYiS/RkQbIdPL2eEkZu\n+IVE\r\n=ndbR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDdoHIJFqKnYRB/NZQvZXNogVYzu5GoLxTKWvpIBUtE0AiEA9Lq9Io62hBlMJtbKMPFaNug3T74DTkA9sJExJCzA6x4="}],"size":3413,"noattachment":false,"key":"/@ipld/codec-interface/-/@ipld/codec-interface-1.0.14.tgz"},"_npmUser":{"name":"mikeal","email":"mikeal.rogers@gmail.com"},"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.14_1614763058118_0.5258303212004622"},"_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":1614763058263,"_cnpm_publish_time":1614763058263,"dist-tags":{"latest":"1.0.14"}}