Socket
Socket
Sign inDemoInstall

websocket-stream

Package Overview
Dependencies
Maintainers
1
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

websocket-stream - npm Package Compare versions

Comparing version 0.5.0 to 0.5.1

2

demo.js
var websocket = require('./')
var elstreamo = require('el-streamo')
ws = websocket('ws://localhost:8080', {type: Uint8Array})
ws = websocket('ws://localhost:8080')
var elstream = elstreamo.writable('#messages')
ws.on('data', function(c) { console.log({foo: c}) })
ws.pipe(elstream)

@@ -22,3 +22,4 @@ var through = require('through')

} else {
this.ws = new WebSocketPoly(server, this.options)
var opts = (process.title === 'browser') ? this.options.protocol : this.options
this.ws = new WebSocketPoly(server, opts)
this.ws.binaryType = this.options.binaryType || 'arraybuffer'

@@ -39,4 +40,4 @@ this.ws.onmessage = this.onMessage.bind(this)

var data = e
if (data.data) data = data.data
if (typeof data.data !== 'undefined') data = data.data
// type must be a Typed Array (ArrayBufferView)

@@ -43,0 +44,0 @@ var type = this.options.type

{
"name": "websocket-stream",
"version": "0.5.0",
"version": "0.5.1",
"description": "websockets with the node stream api. works in browser and node",

@@ -5,0 +5,0 @@ "scripts": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc