# pagination-object-generator

> Generate pagination object.

Latest version **1.0.0** (published 2016-10-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install pagination-object-generator
pnpm add pagination-object-generator
yarn add pagination-object-generator
bun add pagination-object-generator
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2016-10-28 |
| First published | 2016-10-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | keyiiiii |
| Maintainers | keyiiiii |
| Keywords | pagination, paging, generator, object, utils |

## Links

- npm: https://www.npmjs.com/package/pagination-object-generator
- Repository: https://github.com/keyiiiii/pagination-object-generator
- Homepage: https://github.com/keyiiiii/pagination-object-generator#readme
- Issues: https://github.com/keyiiiii/pagination-object-generator/issues
- npm.io page: https://npm.io/package/pagination-object-generator

## Recent versions

- 1.0.0 (latest) — 2016-10-28
- 0.0.2 — 2016-10-10
- 0.0.1 — 2016-10-10

## README

pagination-object-generator
===========================

[![CircleCI](https://circleci.com/gh/keyiiiii/pagination-object-generator/tree/master.svg?style=shield)](https://circleci.com/gh/keyiiiii/pagination-object-generator/tree/master)

Generate pagination object.

It does not depend on the library.

##[DEMO](http://keyiiiii.github.io/pagination-object-generator/example/)

##Usage
`npm install pagination-object-generator`

```javascript
import pagination from "pagination-object-generator";

const offset = 0;
const limit = 20;
const totalCount = 1000;
const showCount = 4;

const results = pagination(offset, limit, totalCount, showCount);
```


```javascript
results = pages:[
  {
    "offset": 0,
    "current": true,
    "firstNum": 1,
    "secondNum": 20,
    "pageNum": 1
  },
  {
    "offset": 20,
    "current": false,
    "firstNum": 21,
    "secondNum": 40,
    "pageNum": 2
  },
  {
    "offset": 40,
    "current": false,
    "firstNum": 41,
    "secondNum": 60,
    "pageNum": 3
  },
  {
    "offset": 60,
    "current": false,
    "firstNum": 61,
    "secondNum": 80,
    "pageNum": 4
  }
],
last:{
  "index": 50,
  "offset": 1000
},
paging:{
  "prev": false,
  "next": 20
}
```

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