diff --git a/doc/api/net.md b/doc/api/net.md index 5b0a5dfee2e52f..ebab15ace61191 100644 --- a/doc/api/net.md +++ b/doc/api/net.md @@ -181,6 +181,38 @@ added: * `value` {any} Any JS value * Returns `true` if the `value` is a `net.BlockList`. +### `blockList.fromJSON(value)` + +> Stability: 1 - Experimental + + + +```js +const blockList = new net.BlockList(); +const data = [ + 'Subnet: IPv4 192.168.1.0/24', + 'Address: IPv4 10.0.0.5', + 'Range: IPv4 192.168.2.1-192.168.2.10', + 'Range: IPv4 10.0.0.1-10.0.0.10', +]; +blockList.fromJSON(data); +blockList.fromJSON(JSON.stringify(data)); +``` + +* `value` Blocklist.rules + +### `blockList.toJSON()` + +> Stability: 1 - Experimental + + + +* Returns Blocklist.rules + ## Class: `net.SocketAddress`