{"name":"@ipld/codec-interface","version":"1.0.4","description":"Codec interface for IPLD.","main":"index.js","directories":{"test":"test"},"scripts":{"test":"nyc --check-coverage --branches=100 --functions=100 --lines=100 --statements=100 aegir test","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":"b82055f620361623af64fcb50b1c8f427338fe43","_id":"@ipld/codec-interface@1.0.4","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"mikeal","email":"mikeal.rogers@gmail.com"},"dist":{"integrity":"sha512-6As3QhWSnOlwIdkM9X4rbPprXlRiZm2f/geYae7i/+0gPLNt9qZaBWMJ1EKL9cX27EUtTPRhlZuisMUlM/NDDw==","shasum":"7c3a6c391726f624a554f17982c2ec8a9ca50456","tarball":"http://registry-npm.ywwl.com/@ipld/codec-interface/download/@ipld/codec-interface-1.0.4.tgz","fileCount":6,"unpackedSize":8441,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc4bdsCRA9TVsSAnZWagAAq3oQAIcpXXDJpE+2br06RnKl\n81azLq7/rEgp3LDkZfezdaHq9jwvrCjqbhsKcaXArRvlU6myADo5apgM6BaC\nTf55Ha3aoki59gq4pgqdFvXXDXwVLsJu7Zguesq7a9pIFcj/HPLJpONg8eSX\nuVAlxZa6aa+5682MruHm3ilWLUVJJDo444SpEfJm3DNh5PtOKJMKhrbKpzIg\nBsF0jmwI/GH466F/BDtfp6//gxIxvlF+6pdq2o9LzdjYzXtZ48k8mgB7jwa3\nojzsJFU9Gm0bpy8sG6upA8KlLbJFw9s6rFDYtB5L+D254HqbQZYBtS+SXTud\naLekaIp4JAjLqoh7PM6GneleC0+PCEUHf7BeL+4igIr9Embg2IaX9tzU/hGR\nVS4is2DyiRVQrW06GWoAI1dzBcmpGm8rETnmmK19yJDoA3Sw65y9yHCisjjz\noCB6dXlBz8b4fppjisFRAF6R/OL+xJXuyKkK0fEVq14pCd/KrsO4kenvz1/s\nq5jEBSjAlXL50AmWfYSZ+TWRsAqXRWXQ1yEHoSdqoMrrFMXaseTWbP5pTkp3\nJaDTGjK7bsSlq8CXLMM0aGaRKsmb/4iSL06s4QnclH5tF2BfN0uZ0H6Y/6iV\nDM0uFrqwTkL+V4pudN0N3T3tkpFwFlGxh79n6NAkA9yzZgYxpUiwg0841bpW\nVYxG\r\n=EUON\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBJYtPWAmyNAU50t0HbvhyYFl8HsBkw0hwb2VUypX2bfAiBaIPokBux+hAEp63jGuOcFLBD48olvEzw63kUAJHGINw=="}],"size":3061,"noattachment":false,"key":"/@ipld/codec-interface/-/@ipld/codec-interface-1.0.4.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.4_1558296427383_0.7447348783551462"},"_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":1558296427511,"_cnpm_publish_time":1558296427511,"dist-tags":{"latest":"1.0.14"}}