Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/ip2location/src/ip2location.d.ts>IPTools

Deno module for IP2Location to lookup the geolocation information
Latest
class IPTools
import { IPTools } from "https://deno.land/x/ip2location@8.3.0/src/ip2location.d.ts";

Methods

baseConvert(
num: number,
fromBase: number,
toBase: number,
): any

A function to convert a number between arbitrary bases.

binaryToIP(myBin: string): string

Converts binary string representation into IPv6.

cidrToIPV4(cidr: string): string[]

Returns the starting and ending IPv4 addresses for the CIDR.

cidrToIPV6(cidr: string): string[]

Returns the starting and ending IPv6 addresses for the CIDR.

compressIPV6(myIP: string): string

Returns the compressed form of the IPv6 address.

decimalToIPV4(ipNum: number): string

Converts an IP number to IPv4 address.

decimalToIPV6(ipNum: string): string

Converts an IP number to IPv6 address.

expandIPV6(myIP: string): string

Returns the expanded form of the IPv6 address.

ipToBinary(myIP: string): string

Converts IPv6 into binary string representation.

ipV4ToCIDR(ipFrom: string, ipTo: string): string[]

Returns an array of the CIDR addresses.

ipV4ToDecimal(myIP: string): number

Converts an IPv4 address to IP number.

ipV6ToCIDR(ipFrom: string, ipTo: string): string[]

Returns an array of the CIDR addresses.

ipV6ToDecimal(myIP: string): any

Converts an IPv6 address to IP number.

isIPV4(myIP: string): boolean

Whether the IP address is an IPv4.

isIPV6(myIP: string): boolean

Whether the IP address is an IPv6.