Auto-paginate every NHL team
Every table exposes an auto-paging iterator that follows the next_from_id keyset cursor until it runs out — so you can consume a whole table without writing the paging loop.
1. Walk every page of teams
The iterator issues one request per page, following the cursor, and yields each row. Collect them all into a list.
curl -sS --compressed \ -H 'Authorization: Bearer YOUR_API_KEY' \ 'https://api.stat-api.com/api/v1/nhl/teams'2. Report how many rows the iterator collected
The auto-pager gathered every team across every page.
console.log(`fetched ${teams.length} teams`)