{"name":"@ipld/codec-interface","version":"1.0.12","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":"fd7175d5ece28c33f9247e2451dc611a2d13309d","_id":"@ipld/codec-interface@1.0.12","_nodeVersion":"12.18.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-IMhSCs9qqOw6CSXpqXx0RacGdjc1OPt49uiGLUf3OwdeZrEkQBvTfaqih4f3xa7E1C/0RQpcICT5Z+lqCqvyXQ==","shasum":"c37d65ad0fb365da1bd1caa5f6d9f03359142b93","tarball":"http://registry-npm.ywwl.com/@ipld/codec-interface/download/@ipld/codec-interface-1.0.12.tgz","fileCount":7,"unpackedSize":10341,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe67K4CRA9TVsSAnZWagAACmMP/A6jMCc846UEN6kyJOEz\nF8H+iFCmbOpI8iurBiIzfqkl4zleRv5sCSASlf2RzmRUveaa3rJamPK2wbQi\nj8lGfQjH4EBh22iuDYXrC7JY5rdqmv5Kzs2/9TeiDSLoXjT1Sj//njWtEVZK\nwQ9VeJe95FfYq7n4PPLVupm6wzdP2GbjvRzSJegvbi2HM1DOGx88ZTxJSNuP\n2k8aVRs/sJxLOSLbYIg4Ykv3Sv7mGc6St7NGUFsIAQZKQwxH/Pshwn9Ot8s1\nLQTeJhaOQ4S6s2Sj0kidXRuTbJvNRlfnAWekzmdMapeuq5WWj2XEEXFdYIuP\n7aCH89yCw6wfiADu149WpUlcFb2TYYAB08jd42V9jONRpWs0y6VziatfOyss\nZVbFyke4eqSIEJoRQS1pfTEDxpDEDDzhOGJfl9dD5I54xGYRtun1V+pJu8Ej\n4fAMoz516SC4NWZf0/7ddAyG18SUmBvf7J2avmNOvORSFBFdvLty5E43jE+2\no7Dwz9VzvVpfCiDWwOSoqPwlf05NPaD/LFi8hIJY8xkRoJIXo9kkkU+kwsKF\ngm/L7+0tTwoCpu7YCPrgJrk+w0nuY4M+wm2dS3XQQKO5Dp4IvFoZ/Yi0/AJg\nk4oMCnzZvnLq5z8QqnNkCl2Chjp0c5dnBzu5Nt9l+xzDPvnO3fBWVQu90I5Z\n+H6d\r\n=ROOA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA244y9pCa73qN46IXp9SdsAVpM0RF72hJFAd319A8AWAiAHkpChZ6kBB/0bX6atuC2/iKxF9osXZsPJTHIOWz9LMQ=="}],"size":3727,"noattachment":false,"key":"/@ipld/codec-interface/-/@ipld/codec-interface-1.0.12.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.12_1592505015739_0.2837120932697843"},"_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":1592505016389,"_cnpm_publish_time":1592505016389,"dist-tags":{"latest":"1.0.14"}}