# pagination-parser

> pagination parser for github api style

Latest version **0.0.4** (published 2018-08-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install pagination-parser
pnpm add pagination-parser
yarn add pagination-parser
bun add pagination-parser
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.4 |
| Published | 2018-08-12 |
| First published | 2018-08-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 9.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | ryota-yamamoto |
| Maintainers | ymmooot |
| Keywords | api, pagination, parser |

## Links

- npm: https://www.npmjs.com/package/pagination-parser
- Repository: https://github.com/ryota-yamamoto/pagination-parser
- Homepage: https://github.com/ryota-yamamoto/pagination-parser#readme
- Issues: https://github.com/ryota-yamamoto/pagination-parser/issues
- npm.io page: https://npm.io/package/pagination-parser

## Dependencies (1)

- [url-parse](https://npm.io/package/url-parse.md) ^1.4.3

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 0.0.4 (latest) — 2018-08-12
- 0.0.3 — 2018-08-12
- 0.0.2 — 2018-08-12
- 0.0.1 — 2018-08-12

## README

# pagination-parser
A parser for [GitHub API v3 style pagination](https://developer.github.com/v3/guides/traversing-with-pagination/) information.

------

## Installing

```bash
$ npm install --save pagination-parser 
```

## Example

```js
const link = `
  <https://api.github.com/search/code?q=addClass+user%3Amozilla&page=15>; rel="next",
  <https://api.github.com/search/code?q=addClass+user%3Amozilla&page=34>; rel="last",
  <https://api.github.com/search/code?q=addClass+user%3Amozilla&page=1>; rel="first",
  <https://api.github.com/search/code?q=addClass+user%3Amozilla&page=13>; rel="prev"
`;
const parsed = parser(link);

/*
{
  first: {
    num: 1,
    url: 'https://api.github.com/search/code?q=addClass+user%3Amozilla&page=1',
  },
  last: {
    num: 34,
    url: 'https://api.github.com/search/code?q=addClass+user%3Amozilla&page=34',
  },
  next: {
    num: 15,
    url: 'https://api.github.com/search/code?q=addClass+user%3Amozilla&page=15',
  },
  prev: {
    num: 13,
    url: 'https://api.github.com/search/code?q=addClass+user%3Amozilla&page=13',
  },
}
*/
```

---
_Source: https://npm.io/package/pagination-parser · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
