
Security News
Knip Hits 500 Releases with v5.62.0, Improving TypeScript Config Detection and Plugin Integrations
Knip hits 500 releases with v5.62.0, refining TypeScript config detection and updating plugins as monthly npm downloads approach 12M.
serialize-stream
Advanced tools
Stream json, ndjson, or csv.
This is useful if you have an API and want to stream different formats depending on a param.
Uses csv-write-stream and JSONStream under the hood.
var ss = require('serialize-stream')
ss('csv')
.on('data', console.log)
.end({a: 1, b: 2, c: 3})
// a,b,c
// 1,2,3
ss('json')
.on('data', console.log)
.end({a: 1, b: 2, c: 3})
// [
// {"a":1,"b":2,"c":3}
// ]
ss('ndjson')
.on('data', console.log)
.end({a: 1, b: 2, c: 3})
// {"a":1,"b":2,"c":3}
ss(format, [opts])
format
is one of: 'csv'
, 'json'
, or 'ndjson'
.
opts
defaults:
{
compact: false, // csv: will remove undefined keys (like in json)
flatten: false // csv: will flatten nested objects using `object2dot`[1]
}
[1] object2dot
MIT
FAQs
Stream as json, ndjson, or csv.
The npm package serialize-stream receives a total of 510 weekly downloads. As such, serialize-stream popularity was classified as not popular.
We found that serialize-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
Knip hits 500 releases with v5.62.0, refining TypeScript config detection and updating plugins as monthly npm downloads approach 12M.
Security News
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.