github-parse-link

Parse GitHub link header response

Usage no npm install needed!

<script type="module">
  import githubParseLink from 'https://cdn.skypack.dev/github-parse-link';
</script>

README

github-parse-link Build Status

Parse GitHub link header response

Install

$ npm install --save github-parse-link

Usage

const parse = require('github-parse-link');

parse('<foo>; rel="next", <bar>; rel="last"');
//=> {next: 'foo', last: 'bar'}

parse('<foz>; rel="prev", <baz>; rel="first"');
//=> {prev: 'foz', first: 'baz'}

API

parse(input)

input

Type: string

The GitHub link header response to parse.

License

MIT © Sam Verschueren