Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
A javascript utility library for working with event streams in the browser.
Estreams, or event streams, are a simple abstraction for reacting to async events. Estreams deal with three different event types: data, error, and end. Estreams at their most basic are stateless transfer tools that just take in events and push them out to consumers. Unlike many other reactive libraries that conflate the concept of data streams, event streams, observables and even data within static arrays, Estream tackles a single use-case and that is async events, which can happen once or continuously throughout the life-cycle of an app.
var clickStream = estream();
var count = 0;
document.addEventListener('click', function(e) {
clickStream.push(++count);
});
clickStream.onData(function(value) {
// value == count
});
Use the combine function: var estream3 = ES.combine([estream1, estream2])
: this wil flow data and errors from both estream1 and estream2 into estream3. However, the combined stream will not end until all of it's parent/source estreams have ended.
An object passed as the second parameter when creating new estreams.
getBuffer
.Estreams flow one way. A consumer cannot trigger an estream to push data or execute a function, nor can it pass data up the stream to be used in some way. However, because anything that has acesss to a stream can push data into it, you can set up a circular flow of reactive estreams. For example:
var estream = require('./estream');
var s1 = estream();
var s2 = estream();
s1.onData(function(val) {
// simulate a server or async action
setTimeout(function() {
s2.push(val + 5);
}, 500);
});
s2.onData(function(val) {
setTimeout(function() {
s1.push(val + 10);
}, 500);
});
s1.push(1); // kick things off.
This library was inspired by my own need to create a predictable way to work with events that you want to transform, combine and observe. I've used a lot of stream and observable libraries but found that there were certain aspects of them that I found confusing or problematic. Estream tries to create a very simple abstraction for dealing with async events in the client.
I was heavily influenced by (and probably directly stole code) from flyd, highland, RxJs, and Bacon
FAQs
A javascript library with a simplified take on event streams.
The npm package estream receives a total of 5 weekly downloads. As such, estream popularity was classified as not popular.
We found that estream 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
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.