{"name":"pull-handshake","description":"make a duplex protocol with a handshake.","version":"0.0.0","homepage":"https://github.com/dominictarr/pull-handshake","repository":{"type":"git","url":"git://github.com/dominictarr/pull-handshake.git"},"dependencies":{},"devDependencies":{},"scripts":{"test":"set -e; for t in test/*.js; do node $t; done"},"author":{"name":"Dominic Tarr","email":"dominic.tarr@gmail.com","url":"dominictarr.com"},"license":"MIT","bugs":{"url":"https://github.com/dominictarr/pull-handshake/issues"},"_id":"pull-handshake@0.0.0","dist":{"shasum":"673a82104074cb5a67f908cf1c1cf4dbe9db4ffc","tarball":"http://registry-npm.ywwl.com/pull-handshake/download/pull-handshake-0.0.0.tgz","integrity":"sha512-oWVfdCD3SuebfuQUvtIh3X19uJm3n5wkTnvMwsMId56vgYiYBRINwyt3qxvZi3ThetYLeqFLGt2Z+ejPyMPVFw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDEFk02nYw/yjBUTrKV17cmbUFuHz8hUfP4uOcLQpg8NgIgbIqP6W+vi+IosQGFQbS3fLCIQlhfZJBbx/PwFjdXcqA="}],"size":3521,"noattachment":false,"key":"/pull-handshake/-/pull-handshake-0.0.0.tgz"},"_from":".","_npmVersion":"1.3.24","_npmUser":{"name":"dominictarr","email":"dominic.tarr@gmail.com"},"maintainers":[{"name":"dominictarr","email":"dominic.tarr@gmail.com"}],"directories":{},"readme":"# pull-handshake\n\nCreate handshakes for binary protocols with pull streams.\n\n# Example\n\n``` js\nvar stream = handshake()\nvar shake = stream.handshake\n\n// Pull some amount of data out of the stream\nshake.read(32, function (err, data) {\n\n  // Write a response...\n  shake.write(new Buffer('hello there'))\n\n  shake.read(32, function (err, data) {\n    // Get a confirmation,\n    // and then attach the application\n    var stream = createApplicationStream()\n\n    pull(stream, shake.rest(), stream)\n    // shake.rest() returns a duplex binary stream.\n  })\n})\n\n\n// shake is itself a duplex pull-stream.\npull(shake, stream, shake)\n```\n\n## API\n\n### `handshake([opts], [callback])`\n\n#### opts\n\nType: `Object`<br>\nDefault: `{timeout: 5e3}`\n\nThe allowed duration for the handshake to take place.\n\n#### callback\n\nType: `Function`<br>\nDefault: `function noop () {}`\n\nThis will be called when the handshake completes, or fails. In the case of failure it is called with an `error`.\n\n## License\n\nMIT\n","publish_time":1396416378798,"_cnpm_publish_time":1396416378798,"dist-tags":{"latest":"1.1.4"}}