{"name":"ipv4-peers","version":"1.0.0","description":"An abstract-encoding compliant encoder for encoding a list of ipv4 peers to buffers","main":"index.js","dependencies":{},"devDependencies":{"standard":"^7.1.2","tape":"^4.6.0"},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/ipv4-peers.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/ipv4-peers/issues"},"homepage":"https://github.com/mafintosh/ipv4-peers","gitHead":"1c85a6c2ac9f641ea4d38b334f7bea71d4d5908c","_id":"ipv4-peers@1.0.0","_shasum":"4ac23c5fee5d1988f611ac45ff559d639ac34e97","_from":".","_npmVersion":"2.15.9","_nodeVersion":"4.4.3","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"4ac23c5fee5d1988f611ac45ff559d639ac34e97","tarball":"http://registry-npm.ywwl.com/ipv4-peers/download/ipv4-peers-1.0.0.tgz","integrity":"sha512-twtKnDRMyh0gBv3pAf5r6OPTCQAhLYjuylzYoyFMJ/Y0kIJmqT/TMfs90GbG5BTe7wn3z4iGpoJ9MazW6pXevg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICr/qaeekGAGfNhJO3kz+dAn7atG4Dw39gN5QQgTb1MSAiEA0l6n4AM5HeI3thq7uKTJAWak3Z3WEmIKNxSZKixoO+s="}],"size":2177,"noattachment":false,"key":"/ipv4-peers/-/ipv4-peers-1.0.0.tgz"},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/ipv4-peers-1.0.0.tgz_1470962360152_0.2790427210275084"},"directories":{},"readme":"# ipv4-peers\n\nAn [abstract-encoding](https://github.com/mafintosh/abstract-encoding) compliant encoder for encoding a list of ipv4 peers to buffers.\n\n```\nnpm install ipv4-peers\n```\n\n[![build status](http://img.shields.io/travis/mafintosh/ipv4-peers.svg?style=flat)](http://travis-ci.org/mafintosh/ipv4-peers)\n\n## Usage\n\n``` js\nvar peers = require('ipv4-peers')\n\nvar buf = peers.encode([{\n  host: '127.0.0.1',\n  port: 8080\n}, {\n  host: '127.0.0.1',\n  port: 9090\n}])\n\nconsole.log(buf) // 12 byte buffer\nconsole.log(peers.decode(buf)) // the peer list\n```\n\n## API\n\n#### `var buf = peers.encode(peerList, [buffer], [offset])`\n\nEncode a list of ipv4 peers into a buffer.\n\n#### `var peers = peers.decode(buffer, [offset], [end])`\n\nDecode a buffer into a list of peers.\n\n#### `var length = peers.encodingLength(peerList)`\n\nReturns the amount of bytes needed to encode the peers into a buffer\n\n#### `peers = peers.idLength(idByteLength)`\n\nCreate a new ipv4-peers decoder that encodes/decodes a fixed size peer id in addition to host/port. The peer id is exposed as the `.id` property on a peer object.\n\n## License\n\nMIT\n","publish_time":1470962361390,"_cnpm_publish_time":1470962361390,"dist-tags":{"latest":"2.0.0"}}