
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.
graph-stringify
Advanced tools
A simple way to produce a compact string representation of an object graph, one node per line. Nodes are tagged with a unique id to properly handle nodes that appear multiple times, as well as cycles.
Install via:
npm install graph-stringify
The sole function is available as the default:
import stringify from "graph-stringify";
obj is the object to stringify. keyProperty is the property of the object that serves as its “type” for pretty printing. If omitted, the object’s constructor’s name is used.
Basic primitives such as undefined, null, numbers, bigints, booleans, strings, and symbols are ignored when passed directly to this function.
If an object is received, its object graph is written with one node per line. Each line contains the node’s type followed by a list of its properties in name=value format. Non-object values are output in place with util.inspect, function values are output as <Function>, and object values (including arrays) are written in subsequent lines and referred to by a reference number.
When invoked without the keyProperty argument:
| Source string | Stringified |
|---|---|
|
|
|
|
|
|
|
|
With the keyProperty argument, e.g. stringify(obj, "kind"):
| Source string | Stringified |
|---|---|
|
|
|
|
Additional examples are found in the test folder.
FAQs
Compact string representation of an object graph, one node per line
We found that graph-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.