JSPM

@baselime/paginate-aws

1.0.6
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 5
  • Score
    100M100P100Q55157F
  • License MIT

Typesafe AWS Pagination using async generators

Package Exports

  • @baselime/paginate-aws
  • @baselime/paginate-aws/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@baselime/paginate-aws) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

paginate-aws

Typesafe AWS Pagination using async generators

Useful when you need to paginate and AWS SDK call (v2/v3). Works with any aws operation with a paginationKey and uses typescript to help (but not guarantee) you have selected the correct pagination key

Pagination Key Help

Install

npm install @baselime/paginate-aws

Usage

import { paginate } from '@baselime/paginate-aws';

for await (const stacks of paginate((next) => cloudFormation.listStacks({ NextToken: next }).promise(), 'NextToken')) {
    console.log(stacks.StackSummaries)
    //=> [{ StackName: 'prod-just-ship-it-be-cool', ...}, ...]
}

API

paginate((next: string) => somePromise({ next }), paginationKey: string)

returns an async generator that paginates through the aws-sdk list method returning all the responses.