
Company News
/Security News
Socket Selected for OpenAI's Cybersecurity Grant Program
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.
jsonarrayfs
Advanced tools
Efficiently handle JSON array files in Node.js with minimal memory usage. Perfect for processing large data volumes without worrying about memory limitations.
"jsonarrayfs" is a Node.js library crafted for robust and memory-efficient management of massive JSON array files. It enables seamless handling of JSON arrays without the need to load the entire file into memory, making it perfect for efficiently managing large datasets without overwhelming system resources.
To install jsonarrayfs, use:
npm install jsonarrayfs
import { createReadStream } from "jsonarrayfs";
// import fs from "fs";
// Option 1: Create a streamer to read JSON array elements from a file
const streamer = await createReadStream("./data.json", { encoding: "utf-8" });
// Option 2: Pass an existing readStream
// const streamer = await createReadStream(fs.createReadStream("./data.json", { encoding: "utf-8" }));
// Stream JSON array elements in batches of 100
for await (const chunk of streamer.stream(100)) {
// Your processing logic here
}
import { createReadStream } from "jsonarrayfs";
const streamer = await createReadStream<{ offer: boolean; price: number }>(
"./data.json",
{ encoding: "utf-8" }
);
// Add filter to the stream to fetch only relevant elements
for await (const chunk of streamer.stream(
100,
(element) => element.price < 500 || element.offer
)) {
// Your processing logic here
}
import { appendFile } from "jsonarrayfs";
// Simulate new data to append
const newData = [
{ id: 1, name: "Earth", price: 1000, offer: true },
{ id: 2, name: "Moon", price: 500, offer: false },
];
// Append new data to the existing JSON array file
await appendFile("./data.json", "utf-8", ...newData);
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
FAQs
Specialized Node.js library for memory-efficient operations on JSON arrays. Stream individual elements from large JSON arrays (files, network responses etc.) and append elements to array files without loading the entire array into memory. Perfect for proc
The npm package jsonarrayfs receives a total of 7 weekly downloads. As such, jsonarrayfs popularity was classified as not popular.
We found that jsonarrayfs 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.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.

Security News
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.

Research
/Security News
Campaign of 108 extensions harvests identities, steals sessions, and adds backdoors to browsers, all tied to the same C2 infrastructure.