{"name":"pull-handshake","description":"easily create a duplex protocol that starts with a handshake","version":"1.1.3","homepage":"https://github.com/dominictarr/pull-handshake","repository":{"type":"git","url":"git://github.com/dominictarr/pull-handshake.git"},"dependencies":{"pull-cat":"^1.1.9","pull-defer":"^0.2.2","pull-delayed-sink":"~1.0.0","pull-pair":"~1.0.0","pull-pushable":"^2.0.0","pull-reader":"^1.2.3","pull-stream":"^3.2.0"},"devDependencies":{"pull-hang":"0.0.0","tape":"~4.0.0"},"scripts":{"prepublish":"npm ls && npm test","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":"7706723251503eefa7b63a54aa30c9b834b00319","bugs":{"url":"https://github.com/dominictarr/pull-handshake/issues"},"_id":"pull-handshake@1.1.3","_shasum":"60cf830ca039b3317a284e39b8811964f971d54f","_from":".","_npmVersion":"3.8.6","_nodeVersion":"5.11.1","_npmUser":{"name":"dominictarr","email":"dominic.tarr@gmail.com"},"dist":{"shasum":"60cf830ca039b3317a284e39b8811964f971d54f","tarball":"http://registry-npm.ywwl.com/pull-handshake/download/pull-handshake-1.1.3.tgz","integrity":"sha512-v4SIo0Xkayyj6fuPGYlz4mFJRtTx3rIVFD1wFW+0wn0ujFxWoiLcVt4wRZq1FTCS0Wdhv+1SZ8rkkQGJSoa6LQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBLNa7Uuk7G/KiQ2hmFOgEWURLTG2i706+MJEKnejhjWAiEAmcFL/iJglbNPExiMGUZDhJkj1yRn7xfU/qFf6gUW1QY="}],"size":2731,"noattachment":false,"key":"/pull-handshake/-/pull-handshake-1.1.3.tgz"},"maintainers":[{"name":"dominictarr","email":"dominic.tarr@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/pull-handshake-1.1.3.tgz_1465861874687_0.7506491669919342"},"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":1465861875243,"_cnpm_publish_time":1465861875243,"dist-tags":{"latest":"1.1.4"}}