Unified network toolkit for IP address manipulation, RDAP operations, DNS management, geolocation queries, and network connectivity detection
This is a monorepo that contains the following packages:
- ipdo - Powerful IP address manipulation library
- rdap - Modern RDAP (Registration Data Access Protocol) client
- undns - Core DNS management library with unified API
- geoip0 - Unified geolocation information query library with multi-provider support
- unping - Unified network connectivity detection library with multi-driver support
# Clone the repository
git clone https://github.com/funish/axis.git
cd axis
# Install dependencies
pnpm install// IP address manipulation with ipdo
import { isValidIP, parseCIDR, ipInRange } from "ipdo";
console.log(isValidIP("192.168.1.1")); // true
const range = parseCIDR("192.168.0.0/24");
console.log(ipInRange("192.168.0.0/24", "192.168.0.1")); // true
// DNS management with undns
import { createDNSManager } from "undns";
import nodeDriver from "undns/drivers/node";
const dns = createDNSManager({
driver: nodeDriver({
servers: ["8.8.8.8", "1.1.1.1"],
}),
});
const records = await dns.getRecords("example.com");
console.log(`Found ${records.length} records`);
// RDAP queries with rdap
import { queryDomain, queryIP, queryASN } from "rdap";
const domainInfo = await queryDomain("example.com");
const ipInfo = await queryIP("8.8.8.8");
const asnInfo = await queryASN("15169");
console.log("Domain:", domainInfo.handle);
console.log("IP Network:", ipInfo.handle);
console.log("ASN:", asnInfo.handle);
// Geolocation queries with geoip0
import { createGeoIPManager } from "geoip0";
import ipsbDriver from "geoip0/drivers/ipsb";
const geoip = createGeoIPManager({
driver: ipsbDriver(),
});
const location = await geoip.lookup("1.1.1.1");
const currentLocation = await geoip.current();
console.log("Location for 1.1.1.1:", location?.country, location?.city);
console.log(
"Current IP location:",
currentLocation?.country,
currentLocation?.city,
);
// Network connectivity detection with unping
import { createPingManager } from "unping";
import tcpDriver from "unping/drivers/tcp";
const ping = createPingManager({
driver: tcpDriver({ port: 80 }),
});
const results = await ping.ping("example.com");
console.log(
`Host is ${results[0].alive ? "reachable" : "unreachable"} (${results[0].time}ms)`,
);# Development mode
pnpm dev
# Build the project
pnpm build
# Run linting
pnpm lint
# Test the implementation
bun playground/drivers/node.ts
bun playground/geoip0/drivers/ipsb.ts
bun playground/geoip0/server.ts
bun playground/unping/drivers/tcp.tsWe welcome contributions! Here's how to get started:
-
Fork the repository on GitHub
-
Clone your fork:
git clone https://github.com/YOUR_USERNAME/axis.git cd axis -
Add upstream remote:
git remote add upstream https://github.com/funish/axis.git
-
Install dependencies:
pnpm install
-
Development mode:
pnpm dev
- Code: Follow our project standards
- Test:
pnpm build - Commit: Use conventional commits (
feat:,fix:, etc.) - Push: Push to your fork
- Submit: Create a Pull Request to upstream repository
This project is licensed under the MIT License - see the LICENSE file for details.
Built with ❤️ by Funish