
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
Yet another stream library
The use of streams is growing in so many languages, but JavaScript is still lacking this functionality natively.
You might say: "But javascript already has .map, .filter and many other functionalities over arrays." Don't get me wrong, it is enough for several use cases, but consider the following example:
[1, 2, 3, 4]
.map(value => value * 2)
.find(element => element > 2)
// expected output: 4
In this case, even though the result comes from the second position of the array, the map iterated all entries before trying to find the right element.
I believe that out there already exists many libraries that do this, but I decided to do my own version in order to learn more about JavaScript.
This module is distributed via npm:
npm install yastream
Everything begins when you create a stream: stream(array).
There are several operation you can perform over a stream, but some can be stacked and others are terminal. In order to solve the stream it is mandatory to perform a terminal operation
For quick examples you can check bellow, but for complete functionality coverage you can look into the test files.
const { stream } = require("yastream")
const result =
stream([1, 2, 3])
.map(value => value * 2)
.filter(value => value > 3)
.do();
// expected result = [4, 6]
const { stream } = require("yastream")
const result =
stream([1, 2, 3])
.map(value => value * 2)
.filter(value => value > 3)
.findFirst(value => value == 4);
// expected result = '4'
// it only iterates the first two element of the array
FAQs
Yet another stream library
We found that yastream 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.