
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.
JSON decycle replaces circular references with {"$ref": PATH}, where PATH is the JSONPath of the first occurrence.
Inspired by cycle.js.
import { decycle } from 'decycle';
const obj = { a: 1 };
obj.self = obj;
JSON.stringify(decycle(obj));
// '{"a":1,"self":{"$ref":"$"}}'
NPM:
npm install decycle
Yarn:
yarn add decycle
CDN:
<script src="https://unpkg.com/decycle@latest/dist/index.umd.js"></script>
ES Modules:
import { decycle } from 'decycle';
CommonJS:
const { decycle } = require('decycle');
UMD:
<script src="https://unpkg.com/decycle@latest/dist/index.umd.js"></script>
<script>
const { decycle } = window.decycle;
</script>
Returns a deep copy of object or array with circular references replaced by {"$ref": PATH}.
Type: unknown
The object or array to decycle.
Type: (value: unknown) => unknown
Optional replacer function called for each value. It receives a value and returns a replacement value.
Circular array:
const array = [];
array[0] = array;
JSON.stringify(decycle(array)); // '[{"$ref":"$"}]'
With replacer:
const obj = { date: new Date('2026-02-07') };
const result = decycle(obj, (value) =>
value instanceof Date ? value.toISOString() : value,
);
// { date: '2026-02-07T00:00:00.000Z' }
Release is automated with Release Please.
FAQs
JSON decycle replaces circular references with JSON path references
The npm package decycle receives a total of 172 weekly downloads. As such, decycle popularity was classified as not popular.
We found that decycle 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.

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.