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

parse-link-header

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

parse-link-header

Parses a link header and returns paging information for each contained link.

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.4M
increased by10.72%
Maintainers
1
Weekly downloads
 
Created

What is parse-link-header?

The parse-link-header npm package is used to parse HTTP link headers, which are commonly used for pagination in APIs. It converts the link header string into a more manageable JavaScript object.

What are parse-link-header's main functionalities?

Parsing Link Headers

This feature allows you to parse a link header string into a JavaScript object. The example demonstrates parsing a GitHub API link header for pagination.

const parse = require('parse-link-header');
const linkHeader = '<https://api.github.com/user/repos?page=2&per_page=100>; rel="next", <https://api.github.com/user/repos?page=5&per_page=100>; rel="last"';
const parsed = parse(linkHeader);
console.log(parsed);

Other packages similar to parse-link-header

Keywords

FAQs

Package last updated on 16 Dec 2021

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