
Security News
The Changelog Podcast: Practical Steps to Stay Safe on npm
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.
@deno.land/isip
Advanced tools
IP address detector for Deno.
import { isIPv4, isIPv6, isIP } from "https://raw.githubusercontent.com/ako-deno/isIP/master/mod.ts";
isIPv4("192.168.0.2"); // true
isIPv4("168.0.2"); // false
isIPv4("2001:0db8:85a3:0000:0000:8a2e:0370:7334"); // false
isIPv6("2001:0db8:85a3:0000:0000:8a2e:0370:7334"); // true
isIPv6("2001:0db8:85a3:0000:0000:8a2e:0370"); // false
isIPv6("192.168.0.2"); // false
isIP("192.168.0.2"); // 4
isIP("168.0.2"); // 0
isIP("2001:0db8:85a3:0000:0000:8a2e:0370:7334"); // 6
isIP("2001:0db8:85a3:0000:0000:8a2e:0370"); // 0
isIPv4(input: string): boolean
Returns true if input is a version 4 IP address, otherwise returns false. It should be compatible with Node.js' net.isIPv4.
isIPv6(input: string): boolean
Returns true if input is a version 6 IP address, otherwise returns false. It should be compatible with Node.js' net.isIPv6.
isIP(input: string): number
Tests if input is an IP address. Returns 0 for invalid strings, returns 4 for IP version 4 addresses, and returns 6 for IP version 6 addresses. It should be compatible with Node.js' net.isIP.
Any incompatibility, please check net_isip_test.ts
FAQs
IP address detector for Deno.
We found that @deno.land/isip demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.