{"name":"libp2p-spdy","version":"0.6.4","description":"SPDY 3.1 implementation wrapper that is compatible with libp2p Stream Muxer expected interface","main":"lib/index.js","jsnext:main":"src/index.js","scripts":{"compliance":"node test/compliance.js | tap-spec","lint":"gulp lint","build":"gulp build","test":"gulp test","test:node":"gulp test:node","test:browser":"gulp test:browser","release":"gulp release","release-minor":"gulp release --type minor","release-major":"gulp release --type major","coverage":"gulp coverage","coverage-publish":"aegir-coverage publish"},"pre-commit":["lint","test"],"repository":{"type":"git","url":"git+https://github.com/libp2p/js-libp2p-spdy.git"},"keywords":["IPFS"],"author":{"name":"David Dias","email":"daviddias@ipfs.io"},"license":"MIT","bugs":{"url":"https://github.com/libp2p/js-libp2p-spdy/issues"},"homepage":"https://github.com/libp2p/js-libp2p-spdy","devDependencies":{"aegir":"^3.2.0","bl":"^1.1.2","chai":"^3.5.0","interface-stream-muxer":"^0.3.1","libp2p-websockets":"^0.7.0","multiaddr":"^2.0.0","pre-commit":"^1.1.2","stream-pair":"^1.0.3","tape":"^4.2.0"},"dependencies":{"browserify-zlib":"github:ipfs/browserify-zlib","interface-connection":"^0.1.6","spdy-transport":"^2.0.11"},"contributors":[{"name":"David Dias","email":"daviddias.p@gmail.com"},{"name":"Francisco Baio Dias","email":"xicombd@gmail.com"},{"name":"JGAntunes","email":"j.goncalo.antunes@gmail.com"},{"name":"dignifiedquire","email":"dignifiedquire@gmail.com"},{"name":"nginnever","email":"ginneversource@gmail.com"}],"gitHead":"77b02997b5e725e1859aa5f245348d283c488d86","_id":"libp2p-spdy@0.6.4","_shasum":"3f661b3b0370f95522554c3e5f0d102a6a1eaa60","_from":".","_npmVersion":"3.8.7","_nodeVersion":"4.3.2","_npmUser":{"name":"daviddias","email":"daviddias.p@gmail.com"},"maintainers":[{"name":"daviddias","email":"daviddias.p@gmail.com"}],"dist":{"shasum":"3f661b3b0370f95522554c3e5f0d102a6a1eaa60","tarball":"http://registry-npm.ywwl.com/libp2p-spdy/download/libp2p-spdy-0.6.4.tgz","integrity":"sha512-qDFPWJL3oQtUrlrk0qpvansr2DU+g5D7ts0ZN+SEbmFbytxF2AtcMnXJhrh9iV0rpb+k56i00YrSfFSfagneyw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD+iaxL0I8rmJxYZh5D8u8PHj14RoN2gV9WN1CsF2iS6wIgJVakKb54ENnQcffEP49oWMc2YFucUIjDTalTucRWvPU="}],"size":546770,"noattachment":false,"key":"/libp2p-spdy/-/libp2p-spdy-0.6.4.tgz"},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/libp2p-spdy-0.6.4.tgz_1466714272881_0.4689499435480684"},"directories":{},"deprecated":"No longer maintained, please use libp2p-mplex instead","readme":"js-libp2p-spdy\n==============\n\n[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io)\n[![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs)\n[![Coverage Status](https://coveralls.io/repos/github/libp2p/js-libp2p-spdy/badge.svg?branch=master)](https://coveralls.io/github/libp2p/js-libp2p-spdy?branch=master)\n[![Dependency Status](https://david-dm.org/libp2p/js-libp2p-spdy.svg?style=flat-square)](https://david-dm.org/libp2p/js-libp2p-spdy)\n[![Travis CI](https://travis-ci.org/libp2p/js-libp2p-spdy.svg?branch=master)](https://travis-ci.org/libp2p/js-libp2p-spdy)\n[![Circle CI](https://circleci.com/gh/libp2p/js-libp2p-spdy.svg?style=svg)](https://circleci.com/gh/libp2p/js-libp2p-spdy)\n[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard)\n![](https://img.shields.io/badge/npm-%3E%3D3.0.0-orange.svg?style=flat-square)\n![](https://img.shields.io/badge/Node.js-%3E%3D6.0.0-orange.svg?style=flat-square)\n\n> SPDY 3.1 implementation wrapper that is compatible with libp2p Stream Muxer expected interface\n\n[![](https://github.com/libp2p/interface-stream-muxer/raw/master/img/badge.png)](https://github.com/libp2p/interface-stream-muxer)\n\n## Lead Maintainer\n\n[Jacob Heun](https://github/jacobheun)\n\n## Installation\n\n### npm\n\n```sh\n> npm i libp2p-spdy\n```\n\n### Use in Node.js\n\n```js\nconst spdy = require('libp2p-spdy')\n```\n\n### Use in a browser with browserify, webpack or any other bundler\n\nThe code published to npm that gets loaded on require is in fact a ES5 transpiled version with the right shims added. This means that you can require it and use with your favourite bundler without having to adjust asset management process.\n\n```JavaScript\nvar spdy = require('libp2p-spdy')\n```\n\n### Use in a browser Using a script tag\n\nLoading this module through a script tag will make the `Lip2pSpdy` obj available in the global namespace.\n\n```html\n<script src=\"https://unpkg.com/libp2p-spdy/dist/index.min.js\"></script>\n<!-- OR -->\n<script src=\"https://unpkg.com/libp2p-spdy/dist/index.js\"></script>\n```\n\n## Usage\n\n### API\n\n#### Attaching it to a socket (duplex stream)\n\n**As a listener**\n\n```JavaScript\nconst listener = spdy(conn, true)\n```\n\n**As a dialer**\n\n```JavaScript\nconst dialer = spdy(conn, false)\n```\n\n#### Opening a multiplex duplex stream\n\n```JavaScript\nconst conn = dialer.newStream((err, conn) => {})\n\nconn.on('error', (err) => {})\n```\n\nnote: Works the same on the listener side\n\n#### Receiving incoming stream\n\n```JavaScript\ndialer.on('stream', (conn) => {})\n```\n\nnote: Works the same on the listener side\n\n#### Close\n\n```JavaScript\ndialer.close()\n```\n\nnote: Works the same on the listener side\n\n#### Other events\n\n```JavaScript\ndialer.on('close', () => {})\ndialer.on('error', () => {})\n```\n\nnote: Works the same on the listener side\n\n### This module uses `pull-streams`\n\nWe expose a streaming interface based on `pull-streams`, rather then on the Node.js core streams implementation (aka Node.js streams). `pull-streams` offers us a better mechanism for error handling and flow control guarantees. If you would like to know more about why we did this, see the discussion at this [issue](https://github.com/ipfs/js-ipfs/issues/362).\n\nYou can learn more about pull-streams at:\n\n- [The history of Node.js streams, nodebp April 2014](https://www.youtube.com/watch?v=g5ewQEuXjsQ)\n- [The history of streams, 2016](http://dominictarr.com/post/145135293917/history-of-streams)\n- [pull-streams, the simple streaming primitive](http://dominictarr.com/post/149248845122/pull-streams-pull-streams-are-a-very-simple)\n- [pull-streams documentation](https://pull-stream.github.io/)\n\n#### Converting `pull-streams` to Node.js Streams\n\nIf you are a Node.js streams user, you can convert a pull-stream to a Node.js stream using the module [`pull-stream-to-stream`](https://github.com/pull-stream/pull-stream-to-stream), giving you an instance of a Node.js stream that is linked to the pull-stream. For example:\n\n```js\nconst pullToStream = require('pull-stream-to-stream')\n\nconst nodeStreamInstance = pullToStream(pullStreamInstance)\n// nodeStreamInstance is an instance of a Node.js Stream\n```\n\nTo learn more about this utility, visit https://pull-stream.github.io/#pull-stream-to-stream.\n\n\n","publish_time":1466714276107,"_cnpm_publish_time":1466714276107,"dist-tags":{"latest":"0.13.3"}}