{"name":"@ipld/codec-interface","version":"1.0.3","description":"Codec interface for IPLD.","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-codec-interface.git"},"bugs":{"url":"https://github.com/ipld/js-codec-interface/issues"},"homepage":"https://github.com/ipld/js-codec-interface#readme","gitHead":"97de1554f8ccc3cb387c3828d0f2e0a092bfcb35","_id":"@ipld/codec-interface@1.0.3","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"mikeal","email":"mikeal.rogers@gmail.com"},"dist":{"integrity":"sha512-BIYjgMP46Ke9jkRfHGIMl8p+na6syzjSgNLcf5ZwCRhTPqXu7aGUEjOkOT6VF9ObSkdvdBPXfj6PwdA2bQ9L1A==","shasum":"f981a9eba5e0f00b8dc19f7390a95c33333b383d","tarball":"http://registry-npm.ywwl.com/@ipld/codec-interface/download/@ipld/codec-interface-1.0.3.tgz","fileCount":6,"unpackedSize":7897,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJczQqZCRA9TVsSAnZWagAAUTcQAKPa3PY4NyxsxYJt+cvd\nur0r9nX92plpP7JjEg0CXlyseVPLjcqeGRc+jlYtB1pScak/zivi+3jr6mNm\nbbnWly9YukbJoY4XWUai66BKFjXdl/Ro81149ZppRtPR5qtsNWeetcPtqpZa\nf+grqDum1VQoysp7/U/k103qI2NVeDmvxTKEXB9bLorFpwQqckk+07TL7hu9\nfHk//wSgUE+XulhRsuMxHNp7I3LW4IocyyrZhjxONiQYwAfeWiOPKVD1i+2b\neZEUNATj3cDeIpwHtHcW3+xSwYd7zHmwWCo0woNpi1H9n9pM/WS+8fwtsfuv\nhY6Rd748xR/hoWLCo31NdvbbHLp3UWkjpPPP+FpNUKD0k6qgERGTksfauS2w\nKbH/2WjCqW2WF2P81SQUJEjAHtU7j2pDLILB/s+fQyr8JdPLIoGz2HS2WG1B\nMJPJt5ySP8bamMnHT12PouzX/sZkfUUvnPMtNYNczxVJ1t8QszggzGCmRsx+\nQXCEN8R73gStimjI0eWxBbdVHcO39Kck/Pladmt/ht61xoyZe98jC4Fene54\nBttcQiCe9iLLVTpf3OI5WS5k0eQNsFkb+ld4o4730kpdItyJzcj3FV/0TWH3\ny5vOXE5Ag12aMSiWRO3ljcLZrAPJC5iHeWIdD4BUrFXPRwQ60XEfdfr3qNt4\nvgoj\r\n=3PNq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDsy4PGi1e6JkfxO+n8co6WxunHJaA96bjqMtkp/ZT48AIhAKQkvC2M9cBTr+sXOS3c6MhkTBnhopeEA0Pt4OzpBNTG"}],"size":2898,"noattachment":false,"key":"/@ipld/codec-interface/-/@ipld/codec-interface-1.0.3.tgz"},"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.3_1556941464576_0.8823517019517508"},"_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":1556941464767,"_cnpm_publish_time":1556941464767,"dist-tags":{"latest":"1.0.14"}}