Security News
PyPI Introduces Digital Attestations to Strengthen Python Package Security
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
browser-stream
Advanced tools
use Stream#pipe
to send data to clients or servers.
wrap socket.io
(or another web socket abstraction that gives a remote EventEmitter
api)
with a interface for creating streams.
npm install browser-stream
var bs = require('browser-stream')(io.connect('http://localhost:3000'))
var domnode = require('domnode') //see https://github.com/maxogden/dominode
var opts = {options: 'pass an optional object with the createReadStream message. maybe useful!'})
//pipe the 'whatever' stream to the dom with dominode.
bs.createReadStream('whatever', options)
.on('error', function (err) {
//unexpected disconnect
console.error(err)
})
.pipe(domnode('#list', '<li id="item"></li>'))
io = io.listen(app) //see https://github.com/LearnBoost/socket.io
var _bs = require('browser-stream')
io.sockets.on('connection', function (sock) {
var bs = _bs(sock)
var whatever = new Stream() // SOME KIND OF STREAM
bs.on('connection', function (stream, opts) {
if(stream.name == 'whatever')
whatever.pipe(stream)
//stream.options -- will be the same as `opts` from the client side!
stream.on('error', function (err) {
//the client has unexpectedly disconnected. tidy up!
console.error(err)
})
})
}
this will connect whatever
to the Dominode
stream, rendering it, in the browser!
var _bs = require('browser-stream')
io.sockets.on('connection', function (sock) {
var bs = _bs(sock)
bs.on('connection', function (stream) {
//stream is a pipable node.js `Stream` instance
})
})
open a ReadableStream
from the other side.
returns a ReadableStream
.
the other side of connection will emit a writable stream that is connected to this stream.
open a WritableStream
to the other side.
returns a WritableStream
, the other side will emit a ReadableStream
connected to this stream.
open a Stream
to the other side which is both readable and writable.
returns a Stream
, the other side will emit a Stream
connected to this stream.
note to self, references to a class (
Stream
) should be capitalized, and in backticks. references to an instance should be lowercase, and not in backticks unless refuring to a specific variable in a code example.
FAQs
pipe streams through Socket.io
We found that browser-stream demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.