Modules@robinpath/pagination

@robinpath/pagination

0.1.1Public

Auto-paginate APIs: cursor, offset, and link-header strategies

@robinpath/pagination

Auto-paginate APIs with offset, cursor, page-number, and Link-header strategies

Category Functions Auth License

Why use this module?

The pagination module lets you:

  • Auto-paginate an API and collect all items
  • Fetch a single page of results
  • Parse a Link header into rel-url pairs
  • Build a paginated URL with page/limit parameters

All functions are callable directly from RobinPath scripts with a simple, consistent API.

Installation

npm install @robinpath/pagination

Quick Start

No credentials needed — start using it right away:

pagination.fetchPage "https://api.example.com/users" 2 {"pageSize": 20}

Available Functions

FunctionDescription
pagination.fetchAllAuto-paginate an API and collect all items
pagination.fetchPageFetch a single page of results
pagination.parseLinkHeaderParse a Link header into rel-url pairs
pagination.buildPageUrlBuild a paginated URL with page/limit parameters

Examples

Fetch a single page of results

pagination.fetchPage "https://api.example.com/users" 2 {"pageSize": 20}

Parse a Link header into rel-url pairs

pagination.parseLinkHeader $linkHeader

Build a paginated URL with page/limit parameters

pagination.buildPageUrl "https://api.example.com/users" 3 {"limit": 50}

Integration with RobinPath

import { RobinPath } from "@wiredwp/robinpath";
import Module from "@robinpath/pagination";

const rp = new RobinPath();
rp.registerModule(Module.name, Module.functions);
rp.registerModuleMeta(Module.name, Module.functionMetadata);

const result = await rp.executeScript(`
  pagination.fetchPage "https://api.example.com/users" 2 {"pageSize": 20}
`);

Full API Reference

See MODULE.md for complete documentation including all parameters, return types, error handling, and advanced examples.

Related Modules

License

MIT

Versions (1)

VersionTagPublished
0.1.1latestyesterday
Install
$ robinpath install @robinpath/pagination
Version0.1.1
LicenseMIT
Unpacked Size4.1 KB
Versions1
Weekly Downloads0
Total Downloads0
Stars0
Last Publishyesterday
Createdyesterday

Category

utilities