{"name":"libp2p-spdy","version":"0.10.2","description":"SPDY 3.1 implementation wrapper that is compatible with libp2p Stream Muxer expected interface","main":"src/index.js","scripts":{"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","browser":{"zlib":"browserify-zlib-next"},"engines":{"node":">=4.0.0"},"devDependencies":{"aegir":"^9.3.3","chai":"^3.5.0","gulp":"^3.9.1","interface-stream-muxer":"^0.5.4","libp2p-tcp":"^0.9.1","libp2p-websockets":"^0.9.1","multiaddr":"^2.1.1","pre-commit":"^1.2.2","pull-file":"^1.0.0","pull-pair":"^1.1.0","pull-stream":"^3.5.0","run-parallel":"^1.1.6","tap-spec":"^4.1.1","tape":"^4.6.3"},"dependencies":{"browserify-zlib-next":"^1.0.0","interface-connection":"^0.3.0","lodash.noop":"^3.0.1","pull-stream-to-stream":"^1.3.3","spdy-transport":"^2.0.18","stream-to-pull-stream":"^1.7.2"},"contributors":[{"name":"David Dias","email":"daviddias.p@gmail.com"},{"name":"Francisco Baio Dias","email":"xicombd@gmail.com"},{"name":"Friedel Ziegelmayer","email":"dignifiedquire@gmail.com"},{"name":"JGAntunes","email":"j.goncalo.antunes@gmail.com"},{"name":"Richard Littauer","email":"richard.littauer@gmail.com"},{"name":"greenkeeperio-bot","email":"support@greenkeeper.io"},{"name":"nginnever","email":"ginneversource@gmail.com"},{"name":"npmcdn-to-unpkg-bot","email":"npmcdn-to-unpkg-bot@users.noreply.github.com"},{"name":"ᴠɪᴄᴛᴏʀ ʙᴊᴇʟᴋʜᴏʟᴍ","email":"victorbjelkholm@gmail.com"}],"gitHead":"3b0a29bcffcafe79da7cd9294c6a1857600f69b0","_id":"libp2p-spdy@0.10.2","_shasum":"c77a55c9778a596e50c6853f5811d4d028459e99","_from":".","_npmVersion":"3.10.9","_nodeVersion":"6.9.2","_npmUser":{"name":"daviddias","email":"daviddias.p@gmail.com"},"maintainers":[{"name":"daviddias","email":"daviddias.p@gmail.com"}],"dist":{"shasum":"c77a55c9778a596e50c6853f5811d4d028459e99","tarball":"http://registry-npm.ywwl.com/libp2p-spdy/download/libp2p-spdy-0.10.2.tgz","integrity":"sha512-hewm9BT26giET0BTonggNyMNgyZOdDKtlVS+kD2rQFyVXZlgeVexspKeMhuTZ8Y3YSrZC3S+jAj8DybS9xa7VQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQChtTyDhYxPz563mXQJMe/vKshY3bc4q7pva/VdXJ9VbgIgbismVRya7ZzQ3XiMZ27wgMWizhCzGK35Af3OB8es21U="}],"size":393519,"noattachment":false,"key":"/libp2p-spdy/-/libp2p-spdy-0.10.2.tgz"},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/libp2p-spdy-0.10.2.tgz_1485035533421_0.6725392492953688"},"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":1485035535621,"_cnpm_publish_time":1485035535621,"dist-tags":{"latest":"0.13.3"}}