# isValid4() function · @imqueue/net

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

Whether a string is a valid IPv4 address.

**Signature:**

```typescript
export declare function isValid4(ip: string): boolean;
```

## Parameters


| Parameter | Type | Description |
| --- | --- | --- |
| ip | string | the string to test |


**Returns:**

boolean

`true` only for IPv4; a valid IPv6 address gives `false`.

## Remarks

Node's `net.isIPv4`. Note that the IPv4-mapped form `::ffff:1.2.3.4` is IPv6 as far as this is concerned.

