{"name":"@ipld/codec-interface","version":"1.0.1","description":"``` npm install @ipld/codec-interface ```","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-ipld-codec-interface.git"},"bugs":{"url":"https://github.com/ipld/js-ipld-codec-interface/issues"},"homepage":"https://github.com/ipld/js-ipld-codec-interface#readme","gitHead":"9c9abaeedb7bce815e86dcc659a602fdd38c75f9","_id":"@ipld/codec-interface@1.0.1","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"mikeal","email":"mikeal.rogers@gmail.com"},"dist":{"integrity":"sha512-iHOJedXeow+9m7Om705I7X0KEUlzAeZ4+oEE3wjIYC9LzWPYsodlwzZtD07ooQLsmprzQgwNTktw1XxOAtH3jQ==","shasum":"bebee815b4fe1e9857d3c142dcdb4bf117e10406","tarball":"http://registry-npm.ywwl.com/@ipld/codec-interface/download/@ipld/codec-interface-1.0.1.tgz","fileCount":6,"unpackedSize":7928,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJczLR6CRA9TVsSAnZWagAALXAP/2ul9uE0FJx/tSIPo/eF\nHFajxIOthppWviS3kl0Lw7yKgTC/2HDkwS56Cv/Zq0jIB/4my6rWBWjL98HH\nftRw98JehryVAsD//9m2VNF/IISw+A1EVLWWmRlSRC3yQA3gw4vQJNmos8kX\nzwPWnnad/kHB7cGalxMavkBEPq7vRbSJ8IIHdkR7955RnBAb905mPKu6yno/\nVztGeB+WiITZ1SlxWXA4kIJ11W4pF/OuCdJsWka+fzclHUZHp6RCDPTyGfzi\nX4OYVmI9kqSjBAs0WlkEYjFOYOMZi3dVpi7HOomWCIH5t642klvn2md2xYsy\nwFTsIcJHAoZC3MV6r4OncNyeYTJsjH4oUcTv6/mEZz1RKNjmffKERJ6nz2Tk\nqTKuOs4c82wC8ubTrhShlkv2UC88zKFisIAOFxbZY4MIxGBfZKihQwqk/B9z\n9AmvRu5sYBcywfgw8iJdRDMMUOorkFFkrBvWmeKvYiY3MKONLTZKbU9CtKpP\n6DdlOLc+T6PPKRECXtBiPJMDz2vwoDntQbL2AnrJOeAn8E3fcZ8on5IoyNnU\nqYGyd8j95Q1I3XXL3Bn6K2OvIx7m6o9mgyd72yO6VKQopeD2YurlJxS7FswT\nXpyqtdX4LeXNTafl9NvmTUDM9gExZETlW3/O6SuV5Zw/zIOtSbc3dH3MpNfA\ndj9J\r\n=XwSi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC8UnNQlLVaTnFd32TioOGP3Ql/o1VhL5/MEV+wdwG3qAiBRVtMro3+HEtQVRMNvCB+zSj7Hz1JqVM0AVAJINOnGpw=="}],"size":2898,"noattachment":false,"key":"/@ipld/codec-interface/-/@ipld/codec-interface-1.0.1.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.1_1556919417313_0.21271342837292773"},"_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":1556919417515,"_cnpm_publish_time":1556919417515,"dist-tags":{"latest":"1.0.14"}}