{"name":"libp2p-spdy","version":"0.2.1","description":"SPDY 3.1 implementation wrapper that is compatible with libp2p Stream Muxer expected interface","main":"src/index.js","scripts":{"lint":"standard","test":"mocha tests/*-test.js","compliance":"node tests/compliance.js"},"pre-commit":["lint","test"],"repository":{"type":"git","url":"git+https://github.com/diasdavid/js-libp2p-spdy.git"},"keywords":["IPFS"],"author":{"name":"David Dias","email":"daviddias@ipfs.io"},"license":"MIT","bugs":{"url":"https://github.com/diasdavid/njs-libp2p-spdy/issues"},"homepage":"https://github.com/diasdavid/js-libp2p-spdy","devDependencies":{"chai":"^3.5.0","interface-stream-muxer":"^0.3.1","pre-commit":"^1.1.2","standard":"^6.0.7","stream-pair":"^1.0.3","tape":"^4.2.0","timed-tape":"^0.1.0"},"dependencies":{"spdy-transport":"^2.0.10"},"gitHead":"3c98d2a6d5b9f5ed7c00b36fe139a148dc391665","_id":"libp2p-spdy@0.2.1","_shasum":"b26a724ba9fd31ac4fb6dc029c1485bfd00e4451","_from":".","_npmVersion":"3.8.0","_nodeVersion":"4.3.2","_npmUser":{"name":"daviddias","email":"daviddias.p@gmail.com"},"maintainers":[{"name":"daviddias","email":"daviddias.p@gmail.com"}],"dist":{"shasum":"b26a724ba9fd31ac4fb6dc029c1485bfd00e4451","tarball":"http://registry-npm.ywwl.com/libp2p-spdy/download/libp2p-spdy-0.2.1.tgz","integrity":"sha512-o95lQpmpVOdMnfr9wp7J53GrQf3BibGkbwlIFSymFf+E10uimlmJ9/D8iPWzIjMjWakfoebDKu5o9ycZUcJDgA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDecwL5sPlL4OnjDtuI+a0yTv5Je19JAU8xLHSPXh6NbAIhAIZ/UV8OgzXFft+PKjtj38S5/3mfPDXt3+rYyEDFy2So"}],"size":2932,"noattachment":false,"key":"/libp2p-spdy/-/libp2p-spdy-0.2.1.tgz"},"_npmOperationalInternal":{"host":"packages-13-west.internal.npmjs.com","tmp":"tmp/libp2p-spdy-0.2.1.tgz_1457305628450_0.4226590171456337"},"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":1457305631776,"_cnpm_publish_time":1457305631776,"dist-tags":{"latest":"0.13.3"}}