{"name":"@ipld/codec-interface","version":"1.0.7","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":"^18.2.2","hundreds":"0.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":"98ef609590b3b51e228b6500f00332312b20377a","_id":"@ipld/codec-interface@1.0.7","_nodeVersion":"10.16.2","_npmVersion":"6.9.0","dist":{"integrity":"sha512-pyLEVYZJTqUdmO1R1pjokP8b0N27WO5VaiYujp507FsmvxVLuKJ0e3h3td86oBOn5S9+JIIlBloLDWqgj9RAVA==","shasum":"31c256c49166759fa2d8044f2abf4100538b8b1e","tarball":"http://registry-npm.ywwl.com/@ipld/codec-interface/download/@ipld/codec-interface-1.0.7.tgz","fileCount":6,"unpackedSize":8407,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdVIIPCRA9TVsSAnZWagAA9usP+gKkNmXDfharMcGGx2tW\nsxmN0YuemOHFXRCeUweSrTJ1GTB/Lcohc4Q6+Z+vdy4BrWC9Kv5XwAaQ6TuI\njVfSo0KUkUDwEwnvwmg8WhDNQxEKH1UvZV5oMl74bhgEJKL7sVe7DwMzWPrv\nGM6hBarGMF48ZyrIR5q6Qg5VBTTiLurhVJIa4iICzLc+rdJrj8N5F/oqamv2\nxTFwPcC4ZYIUouhfmqBo6cuYB14NYmZEveuS4ERo748rJ36rgyOSKEwxV/3U\nW3JCJmgECInwcRUNrA6RZa0zJcCoc1xakFFFbKBz1iVhxJypfEe8lmxZWTen\n64n369NZACQD52G625qs4S6fcSs/++umFNv67M0WKRJJcO49ldYGGSNfa9fZ\nolsV6Au03BltuWE5iNTdjRd0aZ72MYWYa3S3ztQki8CShgqqzyycaXmQdnzD\n+mrQj/aG2pQo9eeI4rc41DKP2WcWLBI79+qTA5UwuYtowHsI1geExXQ/KbkE\nTmFuy77KVYdu7K93M7Xanv7dtFAKeRVLZ6CuqD0I7sJNCqZeKwKy1YhMRnik\naNR7rup7rJxWVHcJ7dbDuCYQEvr/6GS5Ieszz7eFKGV/q1Yl+qUxJT4cPP15\n9shFuqbSwiEHhTSy72AD/LBdDzJbOIYN6TI2WByy034rIxr8Qf/s06YEs15q\nR7+P\r\n=xClo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD2URjc6WMD8hLC+z64Sk3LfhP1BW/87/OzdYAJnFRZAwIgYD/cBtKw+eJoTZOWgPbWfzzCZtIAuZsEZ6DII3ytvrs="}],"size":3057,"noattachment":false,"key":"/@ipld/codec-interface/-/@ipld/codec-interface-1.0.7.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.7_1565819406732_0.4736187799127125"},"_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":1565819406865,"_cnpm_publish_time":1565819406865,"dist-tags":{"latest":"1.0.14"}}