# Networks.toArray() method · @imqueue/net

Source: https://imqueue.org/api/net/latest/net.networks.toarray/
Published: 2026-08-01
Author: @imqueue maintainers (https://github.com/imqueue)
Package: @imqueue/net 3.0.2 — generated reference, not hand-written

Every stored network as CIDR records, IPv4 first.

**Signature:**

```typescript
toArray(canonical?: boolean): string[];
```

## Parameters


| Parameter | Type | Description |
| --- | --- | --- |
| canonical | boolean | _(Optional)_ for IPv6, render the expanded form rather than the compressed one |


**Returns:**

string\[\]

One flat array covering both families, IPv4 records followed by IPv6.

## Default Value

`canonical` defaults to `false`

## Remarks

The result is a valid constructor argument, which makes this the readable way to round-trip a set. Not necessarily the records you built it from, though: each range is re-expressed as its minimal cover, so duplicates are gone and a range spanning several prefixes returns as several records. Addresses covered are identical either way.

