{"name":"pull-handshake","description":"easily create a duplex protocol that starts with a handshake","version":"1.0.2","homepage":"https://github.com/dominictarr/pull-handshake","repository":{"type":"git","url":"git://github.com/dominictarr/pull-handshake.git"},"dependencies":{"pull-stream":"~2.21.0","pull-delayed-sink":"~1.0.0","pull-reader":"~1.1.0","pull-defer":"~0.1.1","pull-pushable":"~1.1.4","pull-cat":"~1.1.7"},"devDependencies":{"tape":"~4.0.0","pull-pair":"~1.0.0"},"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","gitHead":"5730eb317a8884d9bb84872636b2b1ea27105835","bugs":{"url":"https://github.com/dominictarr/pull-handshake/issues"},"_id":"pull-handshake@1.0.2","_shasum":"35ae21ef9d9d21bfe3e9a69b3e698db09235fd82","_from":".","_npmVersion":"2.12.0","_nodeVersion":"2.3.1","_npmUser":{"name":"dominictarr","email":"dominic.tarr@gmail.com"},"maintainers":[{"name":"dominictarr","email":"dominic.tarr@gmail.com"}],"dist":{"shasum":"35ae21ef9d9d21bfe3e9a69b3e698db09235fd82","tarball":"http://registry-npm.ywwl.com/pull-handshake/download/pull-handshake-1.0.2.tgz","integrity":"sha512-nBv79NIWhf8ay85RN+DUY763ylZYeIwFVy6RZxAm3PZtarSP5IgbD9iYxF7YhcBL2IkO4ZG7Qcj1HOTQN5RN3g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC9EhBZoUiz/GaFdF+TapJUuuzEEk7IM0vehUzSEVRgEAiEA5qaDRLuukz4btbzJwtuzr+qg4rXKxwV+fyvz2f+jcYQ="}],"size":2362,"noattachment":false,"key":"/pull-handshake/-/pull-handshake-1.0.2.tgz"},"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":1435941288819,"_cnpm_publish_time":1435941288819,"dist-tags":{"latest":"1.1.4"}}