@pitlane/crawler
crawl() — spider a Remix 3 fetch router in memory. Requests go straight
into router.fetch, so an app can be walked and written to disk without a
socket, a server, or a browser. staticPaths() answers the question that
comes first: which paths a route map can serve with no params.
See
Interfaces
- CrawlOptions. What crawl fetches and how: the starting paths, whether to follow links and queue assets, how many requests run at once, and hooks for
nofollowpages and redirects. Every option has a default, socrawl(router)walks everything reachable from/. - CrawlResult. One fetched path and the response the router produced for it.
- CrawlTarget. What crawl needs from a router. A
createRouter()router satisfies it, and so does anything else that answers aRequest— a built server bundle's default export, a worker-style{ fetch }object, a test double.
Functions
- crawl. Walks an app by dispatching requests straight into its router, yielding each response as it arrives. No socket, no server, no browser: the router's
fetchis the whole transport, so this runs anywhere the app itself runs. - staticPaths. Collects every path in a route map that can be requested without params: the Remix 3 answer to "what pages does this app have", and the input a prerender pass needs before it knows any dynamic values.