
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
json-street
Advanced tools
Simple and efficient streaming JSON processor.
npm install json-street;
Process JSON data incrementally without waiting for it to be fully received:
import * as jsonst from 'json-street;
const response = await fetch('https://api.example.com/data');
const stream = response.body.pipeThrough(new TextDecoderStream());
const items = [];
await jsonst.visit(stream, {
items: item => items.push(item),
});
// {
// "items": [
// { "id": "1", "name": "foo", "metadata": { ... } },
// { "id": "2", "name": "bar", "metadata": { ... } },
// ...
// ]
// }
Specify the expected type of the data to ensure the visitor is appropriately typed:
type Data = {
items: {
id: string;
name: string;
metadata: unknown;
}[];
};
await jsonst.visit<Data>(stream, /* well-typed visitor */)
Use nested visitors to process complex schemas:
type User = {
id: string;
posts: {
title: string;
comments: {
author: string;
text: string;
}[];
}[];
};
const titles = [];
const comments = [];
await jsonst.visit<User>(stream, {
posts: jsonst.array({
title: t => titles.push(t),
comments: jsonst.array(c => comments.push(c)),
})
});
FAQs
Simple and efficient streaming JSON processor.
We found that json-street demonstrated a healthy version release cadence and project activity because the last version was released less than 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.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.