NetworkList.toJSON() method

The CIDR array, so JSON.stringify on this object yields the network list.

Signature:

toJSON(): string[];

Returns:

string[]

The same value as NetworkList.toArray() with no arguments, i.e. compressed IPv6.

Remarks

The result can be handed straight back to the constructor, which makes JSON.parse/new NetworkList a working round trip — lossless in addresses covered, though not necessarily in record count.

Read this page as plain markdown — no HTML, no navigation. For pasting into an LLM, or for an agent to fetch.