
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
pull-stringify
Advanced tools
JSON.stringify as pull stream
var pull = require('pull-stream')
var stringify = require('pull-stringify')
var toPull = require('stream-to-pull-stream')
pull(
pull.values([A, B, C]),
stringify(),
toPull(process.stdout)
)
stringify = require('pull-stringify')pull(
pull.values([A, B, C]),
stringify.lines(),
toPull(process.stdout)
)
stringify(options)options is an object with the following optional keys:
open: string to be prepended to first output stringprefix: string to be prepended to every non-first output stringsuffix: string to be appended to every output stringclose: string to be appended after stream is completeindent: passed as third argument to JSON.stringifystringify: custom function to use instead of JSON.stringifystringify(options) returns a through pull-stream.
defaults options are for double newline delimited json. double newline delimiting means you can use indented json as the stream format, which is more human readable.
{
open: '',
prefix: '',
suffix: '\n\n',
close: '',
indent: 2,
stringify: JSON.stringify
}
stringify.ldjson(stringify)stringify.lines(stringify)for single newline delimited json use stringify.ldjson() or stringify.lines():
{
suffix: '\n',
indent: 0
}
you can pass a custom stringify as an argument.
// compatible with JSON but supports buffers.
var JSONB = require('json-buffer')
// use defaults
stringify({ stringify: JSONB.stringify })
// or
stringify.lines(JSONB.stringify)
stringify.array(stringify)for a single json array use stringify.array()
{
open: '[',
separator: ',\n',
close: ']\n',
indent: 2
}
MIT
FAQs
JSON.stringify as pull-stream
We found that pull-stringify 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.