Skip to content

Search the guides, deployment pages, and API reference.

@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 nofollow pages and redirects. Every option has a default, so crawl(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 a Request — 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 fetch is 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.