ipaddr-js

Installation
SKILL.md

ipaddr.js

Use this skill for ipaddr.js v2 IPv4 and IPv6 parsing, validation, CIDR matching, and range classification. Snapshot 2.5.0 (2026-08). MIT license. CommonJS with bundled types; Node.js 10+ and browsers. Express (proxy-addr) depends on it.

Workflow

  1. Inspect the local surface: ipaddr.js version (2.x; 1.x is for Node < 10), import style, and whether input comes from sockets, headers, or user text.
  2. Pick the entry point:
    • Untrusted text, strict: ipaddr.IPv4.isValidFourPartDecimal(s) or ipaddr.IPv6.isValid(s), then ipaddr.parse(s).
    • Socket / dual-stack address: ipaddr.process(s) to unwrap ::ffff:a.b.c.d to IPv4.
    • CIDR config: ipaddr.parseCIDR(s) once at startup, then addr.match(range) or ipaddr.subnetMatch.
  3. Route detail:
  4. Prefer bun / bunx in command examples. Import as import ipaddr from 'ipaddr.js' (ESM interop with esModuleInterop) or const ipaddr = require('ipaddr.js'). Match the project.

Quick Reference

Installs
1
GitHub Stars
3
First Seen
1 day ago