Modules@robinpath/pagination
@robinpath/pagination
0.1.1PublicAuto-paginate APIs: cursor, offset, and link-header strategies
@robinpath/pagination
Auto-paginate APIs with offset, cursor, page-number, and Link-header strategies
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
| Function | Description |
|---|---|
pagination.fetchAll | Auto-paginate an API and collect all items |
pagination.fetchPage | Fetch a single page of results |
pagination.parseLinkHeader | Parse a Link header into rel-url pairs |
pagination.buildPageUrl | Build 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
@robinpath/json— JSON module for complementary functionality
License
MIT
Versions (1)
| Version | Tag | Published |
|---|---|---|
| 0.1.1 | latest | yesterday |
Related Modules
utilities
1
@dev-tester/hello-world
v2.0.0dev-tester
Updated description
0 downloads
...
utilities
0
@robinpath/apollo
v0.1.1robinpath
Apollo module for RobinPath.
0 downloads
...
utilities
0
@robinpath/archive
v0.1.1robinpath
Create and extract .zip and .tar.gz file archives
0 downloads
...
utilities
0
@robinpath/assert
v0.1.1robinpath
Testing assertions: equal, deepEqual, truthy, falsy, type checks, includes, matches, throws, and more
0 downloads
...
Install
$ robinpath install @robinpath/pagination Version0.1.1
LicenseMIT
Unpacked Size4.1 KB
Versions1
Weekly Downloads0
Total Downloads0
Stars0
Last Publishyesterday
Createdyesterday

