{"analyzedAt":"2022-07-01T20:24:12.965Z","collected":{"metadata":{"name":"hyperswarm-ws","scope":"unscoped","version":"1.2.0","description":"Joining Hyperswarms via WebSocket gateways","keywords":["hyperswarm","websocket","p2p"],"date":"2019-11-17T15:00:47.692Z","author":{"name":"Jan Kaßel","email":"jan@kassel.works","username":"falafeljan"},"publisher":{"username":"falafeljan","email":"jan@kassel.works"},"maintainers":[{"username":"falafeljan","email":"jan@kassel.works"}],"repository":{"type":"git","url":"git+https://github.com/falafeljan/hyperswarm-ws.git"},"links":{"npm":"https://www.npmjs.com/package/hyperswarm-ws","homepage":"https://github.com/falafeljan/hyperswarm-ws#readme","repository":"https://github.com/falafeljan/hyperswarm-ws","bugs":"https://github.com/falafeljan/hyperswarm-ws/issues"},"license":"MIT","dependencies":{"crypto-browserify":"^3.12.0","debug":"^4.1.1","hyperswarm-proxy":"^1.2.1","is-stream":"^2.0.0","minimist":"^1.2.0","websocket-stream":"^5.5.0"},"devDependencies":{"standard":"^14.3.1"},"releases":[{"from":"2022-06-01T00:00:00.000Z","to":"2022-07-01T00:00:00.000Z","count":0},{"from":"2022-04-02T00:00:00.000Z","to":"2022-07-01T00:00:00.000Z","count":1},{"from":"2022-01-02T00:00:00.000Z","to":"2022-07-01T00:00:00.000Z","count":1},{"from":"2021-07-01T00:00:00.000Z","to":"2022-07-01T00:00:00.000Z","count":1},{"from":"2020-07-01T00:00:00.000Z","to":"2022-07-01T00:00:00.000Z","count":1}],"hasTestScript":true,"readme":"# Hyperswarm WebSocket Bridge\n\nUse a WebSocket gateway to bridge Hyperswarm connections via [`hyperswarm-proxy`](https://github.com/RangerMauve/hyperswarm-proxy) to the browser.\n\n```\nnpm install hyperswarm-ws\n```\n\n## Usage\n\nJoin a Hyperswarm via a WebSocket gateway. For more, look up the [Hyperswarm documentation](https://github.com/hyperswarm/hyperswarm).\n\n```js\nconst crypto = require('crypto')\nconst { ClientSwarm } = require('hyperswarm-ws')\n\n// look for peers listed under this topic\nconst topic = crypto\n  .createHash('sha256')\n  .update('my-hyperswarm-topic')\n  .digest()\n\nconst swarm = new ClientSwarm('ws://localhost:4200')\nswarm.join(topic)\n```\n\n## API\n\n#### `swarm = new ClientSwarm(gateway, [opts])`\n\nCreate a new client instance that connects to a WebSocket gateway given the a gateway URL. `gateway` may alternatively be a websocket connection stream (created using [`websocket-stream`](https://github.com/maxogden/websocket-stream)).\n\nThe class extends `HyperswarmProxyClient` of [`hyperswarm-proxy`](https://github.com/RangerMauve/hyperswarm-proxy), so it will\n\n- use the options specified by `opts`, with\n  - `opts.pingInterval` being the interval used for pinging clients (default: 3500 ms),\n- pass all other opts to its parent constructor, and\n- inherit all instance methods, such as `reconnect`, `join`, `leave`, `destroy`.\n\n#### `swarm = async createClientSwarm(gatewayUrls)`\n\nGiven an array of gateway URLs, try all gateways for working connections until the first one is found. Will pass that URL as websocket stream to a new `ClientSwarm` instance.\n\nIf none of the gateways works, an error with `err.code = 'EBADGATEWAYS'` is thrown.\n\n## Running a Gateway\n\nFor running a gateway, use `hyperswarm-ws-gateway [-p <port>]`. Will run a WebSocket gateway on the given port that bridges all incoming WebSocket streams into the Hyperswarm network."},"npm":{"downloads":[{"from":"2022-06-30T00:00:00.000Z","to":"2022-07-01T00:00:00.000Z","count":0},{"from":"2022-06-24T00:00:00.000Z","to":"2022-07-01T00:00:00.000Z","count":2},{"from":"2022-06-01T00:00:00.000Z","to":"2022-07-01T00:00:00.000Z","count":14},{"from":"2022-04-02T00:00:00.000Z","to":"2022-07-01T00:00:00.000Z","count":101},{"from":"2022-01-02T00:00:00.000Z","to":"2022-07-01T00:00:00.000Z","count":177},{"from":"2021-07-01T00:00:00.000Z","to":"2022-07-01T00:00:00.000Z","count":383}],"starsCount":0},"github":{"starsCount":9,"forksCount":0,"subscribersCount":1,"issues":{"count":15,"openCount":2,"distribution":{"3600":2,"10800":0,"32400":0,"97200":0,"291600":2,"874800":3,"2624400":3,"7873200":2,"23619600":3,"70858800":0,"212576400":0},"isDisabled":false},"contributors":[{"username":"jankaszel","commitsCount":43},{"username":"dependabot[bot]","commitsCount":4}],"commits":[{"from":"2022-06-24T00:00:00.000Z","to":"2022-07-01T00:00:00.000Z","count":0},{"from":"2022-06-01T00:00:00.000Z","to":"2022-07-01T00:00:00.000Z","count":0},{"from":"2022-04-02T00:00:00.000Z","to":"2022-07-01T00:00:00.000Z","count":0},{"from":"2022-01-02T00:00:00.000Z","to":"2022-07-01T00:00:00.000Z","count":0},{"from":"2021-07-01T00:00:00.000Z","to":"2022-07-01T00:00:00.000Z","count":0}]},"source":{"files":{"readmeSize":1867,"testsSize":0},"linters":["standard"],"outdatedDependencies":{"is-stream":{"required":"^2.0.0","stable":"3.0.0","latest":"3.0.0"}}}},"evaluation":{"quality":{"carefulness":0.84,"tests":0,"health":0.75,"branding":0},"popularity":{"communityInterest":12,"downloadsCount":33.666666666666664,"downloadsAcceleration":-0.16215753424657536,"dependentsCount":0},"maintenance":{"releasesFrequency":0.9,"commitsFrequency":0.9,"openIssues":1,"issuesDistribution":0.9}},"score":{"final":0.5221895465501013,"detail":{"quality":0.5214660043951557,"popularity":0.045092888782640776,"maintenance":0.9999063833075152}}}