Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@azure/core-paging

Package Overview
Dependencies
Maintainers
2
Versions
274
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@azure/core-paging

Core types for paging async iterable iterators

  • 1.6.3-alpha.20241015.2
  • npm
  • Socket score

Version published
Weekly downloads
1.6M
decreased by-55.02%
Maintainers
2
Weekly downloads
 
Created

What is @azure/core-paging?

@azure/core-paging is a library that provides utilities for handling paginated responses from Azure services. It simplifies the process of iterating over paginated data, making it easier to work with large sets of data that are returned in multiple pages.

What are @azure/core-paging's main functionalities?

Iterating over paginated results

This feature allows you to iterate over paginated results using an asynchronous iterator. The code sample demonstrates how to use the PagedAsyncIterableIterator to loop through items returned by a client's listItems method.

const { PagedAsyncIterableIterator } = require('@azure/core-paging');

async function iteratePages(client) {
  const pagedIterator = client.listItems();
  for await (const item of pagedIterator) {
    console.log(item);
  }
}

Handling paginated responses

This feature allows you to handle paginated responses page by page. The code sample demonstrates how to use the byPage method to iterate through each page of results and process the items within each page.

const { PagedAsyncIterableIterator } = require('@azure/core-paging');

async function handlePages(client) {
  const pagedIterator = client.listItems();
  let pageCount = 0;
  for await (const page of pagedIterator.byPage()) {
    console.log(`Page ${++pageCount}:`);
    for (const item of page) {
      console.log(item);
    }
  }
}

Other packages similar to @azure/core-paging

Keywords

FAQs

Package last updated on 15 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc