@birdcc/intel
v0.0.1-2026-03-23.5
Published
ASN intelligence database for BIRD2 LSP — weekly-updated lookup engine powered by BGP.Tools OpenDB.
Maintainers
Readme
@birdcc/intel
ASN intelligence database for the BIRD2 LSP toolchain.
Provides near-instant ASN lookup (exact + prefix search) powered by a compressed msgpack binary derived from BGP.Tools OpenDB.
Features
- Exact lookup — O(1) via
Map, ~68ps per call - Prefix search — Binary search + lexicographic scan, ~200-240ns for limit=10
- Country flag emoji — ISO 3166-1 alpha-2 → regional indicator symbols
- Display formatting — Inlay hints, completion details, hover markdown
Usage
import { createAsnIntel } from "@birdcc/intel";
const intel = createAsnIntel();
// Exact lookup
const entry = intel.exactLookup(13335);
// => { asn: 13335, name: "Cloudflare, Inc.", cls: "Content", cc: "US" }
// Prefix search
const results = intel.prefixSearch("1333", 5);
// => [{ asn: 13335, ... }, ...]
// Formatted display
const display = intel.lookupDisplay(13335);
// => { inlayLabel: "🇺🇸 AS13335", completionDetail: "🇺🇸 AS13335 · Cloudflare, Inc.", ... }Database Rebuild
# Download latest CSV and rebuild
pnpm build:db
# Or use a local CSV file
pnpm build:db -- --csv ./path/to/asns.csvVersioning
This package uses calendar versioning via semver prerelease tags: 0.0.1-YYYY-MM-DD.RUN_NUMBER (UTC).
The intel-asn-update workflow also uses YYYY-MM-DD in commit messages for readability.
License
GPL-3.0-only
