
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
csv-async-generator
Advanced tools
A tiny CSV library to serialize and deserialize in a performant way. You can take a look at the kind of memory problems it can solve at [serialize-async-generator.test.ts](src/__tests__/serialize-async-generator.test.ts).
A tiny CSV library to serialize and deserialize in a performant way. You can take a look at the kind of memory problems it can solve at serialize-async-generator.test.ts.
expect(
serialize(
[
{ propA: "A1", propB: "B1" },
{ propA: "A2", propB: "B2" },
],
[
{ header: "A", cell: (item) => item.propA },
{ header: "B", cell: (item) => item.propB },
],
),
).toBe("A;B\r\n" + "A1;B1\r\n" + "A2;B2\r\n");
const getPositiveNumbers = async function* () {
let number = 1;
while (true) {
yield Promise.resolve(number);
number++;
}
};
const limit = async function* <Item>(items: AsyncIterable<Item>, max: number) {
let count = 0;
for await (const item of items) {
if (count >= max) {
return;
}
yield item;
count++;
}
};
const filter = async function* <Item>(
items: AsyncIterable<Item>,
predicate: (item: Item) => any,
) {
for await (const item of items) {
if (predicate(item)) {
yield item;
}
}
};
const map = async function* <Input, Output>(
items: AsyncIterable<Input>,
mapper: (item: Input) => Output,
) {
for await (const item of items) {
yield mapper(item);
}
};
const getFirstFiveEvenPositiveNumbersAsItems = () =>
map(
limit(
filter(getPositiveNumbers(), (it) => it % 2),
5,
),
(it) => ({ value: String(it) }),
);
const lines: Array<string> = [];
for await (const line of serializeAsyncGenerator(
getFirstFiveEvenPositiveNumbersAsItems(),
[{ header: "Value", cell: (item) => item.value }],
)) {
lines.push(line);
}
expect(lines).toStrictEqual([
"Value\r\n",
"1\r\n",
"3\r\n",
"5\r\n",
"7\r\n",
"9\r\n",
]);
FAQs
A tiny CSV library to serialize and deserialize in a performant way. You can take a look at the kind of memory problems it can solve at [serialize-async-generator.test.ts](src/__tests__/serialize-async-generator.test.ts).
The npm package csv-async-generator receives a total of 0 weekly downloads. As such, csv-async-generator popularity was classified as not popular.
We found that csv-async-generator 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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.