Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Provides an intuitive interface for node streams, in typescript.
npm install --save o-stream
Or dev:
npm install --save-dev o-stream
Simple transform stream:
import ObjectStream, { EnteredArgs } from "o-stream"
let incrementStream = ObjectStream.transform<number, number>({
onEntered: (args: EnteredArgs<number, number>) => {
args.output.push(args.object + 1);
}
});
stream.write(4);
let actual = stream.read(); // 5
Output on stream end:
import ObjectStream, { EnteredArgs, EndedArgs } from "o-stream"
let sum = 0;
let sumStream = ObjectStream.transform<number, number>({
onEntered: (args: EnteredArgs<number, number>) => {
sum += args.object;
},
onEnded: (args: EndedArgs<number>) => {
args.output.push(sum);
}
});
sumStream.write(100);
sumStream.write(5);
sumStream.write(-10);
sumStream.end();
let actualSum = sumStream.read(); // 95
Async:
import ObjectStream, { EnteredAsyncArgs, EndedAsyncArgs } from "o-stream"
let sum = 0;
let sumStream = ObjectStream.transform<number, number>({
onEnteredAsync: (args: EnteredAsyncArgs<number, number>) => {
sum += args.object;
args.done();
},
onEndedAsync: (args: EndedAsyncArgs<number>) => {
args.output.push(sum);
args.done();
}
});
let num1 = 4;
let num2 = 6;
let num3 = -1;
let expected = num1 + num2 + num3;
sumStream.write(num1);
sumStream.write(num2);
sumStream.write(num3);
sumStream.end();
let actual = sumStream.read();
expect(actual).toBe(expected);
Create a stream from an array:
import ObjectStream from "o-stream"
let stream = ObjectStream.fromArray([1, 2, 3, 5, 8, 13]);
FAQs
Intuitive node streams in typescript.
The npm package o-stream receives a total of 13,619 weekly downloads. As such, o-stream popularity was classified as popular.
We found that o-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
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.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.