CLI TypeScript crawler that visits every same-host URL from a seed page, prints links found (including external), and uses a dynamic FIFO frontier with bounded Promise.race() concurrency.
- Node.js 20+
npm installQuick crawl:
npm run crawl -- https://www.example.com/With options:
npm run crawl -- https://www.example.com/ --concurrency=2 --timeout=5000| Flag | Default | Meaning |
|---|---|---|
--concurrency |
5 |
Max pages fetched at once |
--timeout |
5000 |
Per-request timeout in ms |
npm test
npm run test:coverage
npm run typecheck
npm run lint
npm run buildThe scheduler is work-conserving and bounded:
- Fill
activefrom the FIFO queue untilactive.size === concurrency. await Promise.race(active.values())for the first completion.- Report that result, schedule new same-domain links, refill free slots.
- Stop when both the queue and
activeare empty.