Docs/API reference

PaginationConfig · Node.js

Choose how a crawler discovers the next page.

Download .md
Developers2 min read9 sections
Source reference · Match your SDK version. Availability and known issues
In this guide

Purpose and lifecycle

Use the named factories rather than calling the constructor. Attach the returned configuration with Crawl.withPagination/with_pagination.

Set crawl limits even when pagination has its own maximum. A URL pattern is not evidence that every generated page exists.

Definition and availability

Source snapshot: 1.0.0-alpha.3. Package export. Declared in source; this is not a runtime test result.

Signatures and source locations are generated from the SDK wrappers. Clean snapshots link to the recorded commit. Modified snapshots link to main, which may differ; file hashes identify the local inputs.

export class PaginationConfig
typescript1 lines · copy-ready

Usage example

Use a matching source build. Where a snippet uses page, obtain it with the Page example first. Example URLs illustrate API shape; they are not promised datasets.

import { Crawl, PaginationConfig } from 'crawlingo';
const crawl = new Crawl('https://example.com/catalog?page=1')
  .withPagination(PaginationConfig.pageNumber('https://example.com/catalog?page={page}', 1, 5))
  .limit(5).field('title', 'h1');
typescript4 lines · copy-ready

Members

MemberKindReturn / value typeSource status
innerpropertyJsPaginationConfigPresent in source
nextLinkstatic methodPaginationConfigPresent in source
pageNumberstatic methodPaginationConfigPresent in source
urlPatternstatic methodPaginationConfigPresent in source

inner

Native interop handle. Prefer the documented wrapper methods; bypassing them can bypass validation and typed error conversion.

Returns / value: JsPaginationConfig.

public readonly inner: JsPaginationConfig;
typescript1 lines · copy-ready

pageNumber()

Construct numbered URLs from a template containing {page}, starting at startPage/start_page and bounded by maxPages/max_pages.

Returns / value: PaginationConfig.

pageNumber(urlTemplate: string, startPage: number, maxPages: number): PaginationConfig
typescript1 lines · copy-ready
ParameterTypeRequired / defaultMeaning
urlTemplatestringRequiredURL template containing the literal {page} placeholder.
startPagenumberRequiredFirst page number used by numbered pagination.
maxPagesnumberRequiredNumbered-pagination bound passed to the native configuration.

urlPattern()

Increment the page number captured by a regular expression in the current URL; stop at the configured maximum.

Returns / value: PaginationConfig.

urlPattern(pageRegex: string, maxPage: number): PaginationConfig
typescript1 lines · copy-ready
ParameterTypeRequired / defaultMeaning
pageRegexstringRequiredRegular expression capturing the current page number in a URL.
maxPagenumberRequiredUpper page-number bound for pattern pagination.

Errors and operational limits

Invalid patterns or templates can fail when evaluated by the crawler. Validate a small URL sequence before a larger crawl.

Source availability, package publication and runtime validation are separate facts. These pages describe the source snapshot, not a claim that all platforms or every API path have passed production acceptance.