JSPM

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

Parse & format HTTP link headers according to RFC 5988

Package Exports

  • http-link-header

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 (http-link-header) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

HTTP Link Header

npm npm license npm downloads build status

Parse & format HTTP link headers according to RFC 5988

Install via npm

$ npm install --save http-link-header

Status

It can currently parse (almost) everything according to the RFC, with exception of a few cases where control chars show up in attribute values:

  • attribute contains semicolon
  • attribute contains comma
  • multiple links contain mixed comma & semicolon

Usage

var LinkHeader = require( 'http-link-header' )
var link = LinkHeader.parse(
  '<example.com>; rel="example"; title="Example Website", ' +
  '<example-01.com>; rel="alternate"; title="Alternate Example Domain"'
)

> Link {
  refs: [
    { uri: 'example.com', rel: 'example', title: 'Example Website' },
    { uri: 'example-01.com', rel: 'alternate', title: 'Alternate Example Domain' },
  ]
}
link.rel( 'alternate' )
> { uri: 'example-01.com', rel: 'alternate', title: 'Alternate Example Domain' }
link.has( 'rel', 'alternate' )
> true
link.get( 'title', 'alternate' )
> { uri: 'example-01.com', rel: 'alternate', title: 'Alternate Example Domain' }