{"name":"@ipld/codec-interface","version":"1.0.11","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":"93bfa46de54ee8fa973267d973c4b5bfa1909b54","_id":"@ipld/codec-interface@1.0.11","_nodeVersion":"12.18.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-DvYV5oUzi0wd2GAHTz7Ix/2HjJftbortIsUmhEJY7t1x7v+Hrpz9T5ievGqRIBNvfQ9dBytRp5+C/XxvvOmnNQ==","shasum":"b7b521eb619538eafef13aaabc13fb1b143534ce","tarball":"http://registry-npm.ywwl.com/@ipld/codec-interface/download/@ipld/codec-interface-1.0.11.tgz","fileCount":7,"unpackedSize":9837,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe67IGCRA9TVsSAnZWagAAM5sQAKBCoaT6AxzKw11yU+jO\n3vJeJaZ//Sxahh8rxvb2cF7ayFKKe+3Izt6G0LmLVCAqpE80npZyIy+Gz1KB\nPpB6zFdV3CR9ezcpubaK5lX7v86NgNE219wbPcPYlZjKCnOq+DawP2U4lZ/z\nsDYGAJzp3H6dHQz+FIY3fPb5topkI1KQrU8D1nJlREnv7bQCU8nMQXKvy6T/\n7QSkcS5exgfwmoWTdTmOqGKisvto1wC9EeaNo8XFitiveh3EaZqiLBFdCd2U\nGYt0J8wjUO2MxF2K+maj1w6i/s8mc0r/u08AgXFPhp74Ag9tFssXT3mDK5v+\nRqFsyRw4ZzFV5Bm9nMpRrqMWCWCePh7zL8nvnf2XHCMFeu+KRHdNA996V+gZ\nJ9Y2frpwkV8e1On4cQFv3sxaAsIndLoGLe1jn7tuUDjPhG53r9C9CVbArL72\nnL/HGltm+wNdbqam+9qBtprxSOo07WLBRX7/uPGoTt/LGL4EY/o6Tetr6Sgr\n/b7PclXOAyPwXCoZjsgndIoiW0V9WXhZEWWG+un9UaxVGvqmghn6MuFS4zA/\n3Yg9TctwbvbXJ4VuGPuz9OHRsj9hP20aCrKf49LbtpAfIt25LY2BdANWlOR8\nhdcEqKtO1vODTfJUO4s9o89CVYyhwtlkPtES/Rdlt6l+3hZBbErPL9a5paNS\n+5cs\r\n=ayX7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDPqoP5sMWmi9WYhqpPI62wHWFPDQDoh5Rrv5BuOdpcNQIhAItLET8rPOwgQd0DNxKM3p2N3GHYSk1iapjEyZ5HxYLj"}],"size":3623,"noattachment":false,"key":"/@ipld/codec-interface/-/@ipld/codec-interface-1.0.11.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.11_1592504838176_0.20064659253172845"},"_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":1592504838293,"_cnpm_publish_time":1592504838293,"dist-tags":{"latest":"1.0.14"}}