Skip to main content
isIPv4 - node__net.d.ts - Node documentation
function isIPv4

Usage in Deno

```typescript import { isIPv4 } from "node:node__net.d.ts"; ```
isIPv4(input: string): boolean
Returns `true` if `input` is an IPv4 address in [dot-decimal notation](https://en.wikipedia.org/wiki/Dot-decimal_notation) with no leading zeroes. Otherwise, returns `false`. ```js net.isIPv4('127.0.0.1'); // returns true net.isIPv4('127.000.000.001'); // returns false net.isIPv4('127.0.0.1/24'); // returns false net.isIPv4('fhqwhgads'); // returns false ```

Parameters

input: string

Return Type

boolean