# pagelist

> ## Install

Latest version **1.0.4** (published 2021-09-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install pagelist
pnpm add pagelist
yarn add pagelist
bun add pagelist
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2021-09-22 |
| First published | 2021-09-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=12 |
| Dependencies | 0 |
| Unpacked size | 14.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Andrei Canta |
| Maintainers | deiucanta |

## Links

- npm: https://www.npmjs.com/package/pagelist
- Repository: https://github.com/deiucanta/pagelist
- npm.io page: https://npm.io/package/pagelist

## Recent versions

- 1.0.4 (latest) — 2021-09-22
- 1.0.3 — 2021-09-22
- 1.0.2 — 2021-09-22
- 1.0.1 — 2021-09-22
- 1.0.0 — 2021-09-22

## README

# Pagelist

## Install

```
npm install pagelist
```

```
yarn add pagelist
```

## Usage

```js
import { pagelist } from 'pagelist';

const current = 1;
const total = 500;
const display = 9;

pagelist(current, total, display);
// => 1, 2, 3, 4, 5, 6, 7, _, 500
```

## Examples

| Current | Total | Display | Result                                  |
| ------- | ----- | ------- | --------------------------------------- |
| 1       | 1     | 10      | `[1]`                                   |
| 1       | 10    | 10      | `[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]`       |
| 2       | 10    | 10      | `[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]`       |
| 1       | 1000  | 10      | `[1, 2, 3, 4, 5, 6, 7, 8, '-', 1000]`   |
| 5       | 1000  | 10      | `[1, 2, 3, 4, 5, 6, 7, 8, '-', 1000]`   |
| 6       | 1000  | 10      | `[1, '-', 4, 5, 6, 7, 8, 9, '-', 1000]` |
| 500     | 1000  | 7       | `[1, '-', 499, 500, 501, '-', 1000]`    |
| 1000    | 1000  | 7       | `[1, '-', 996, 997, 998, 999, 1000`     |
| 995     | 1000  | 7       | `[1, '-', 994, 995, 996, '-', 1000]`    |

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