# clay-list-pager

> List pager for ClayDB

Latest version **3.0.1** (published 2018-08-12) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install clay-list-pager
pnpm add clay-list-pager
yarn add clay-list-pager
bun add clay-list-pager
```

## 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 | 3.0.1 |
| Published | 2018-08-12 |
| First published | 2017-04-05 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8 |
| Dependencies | 1 |
| Unpacked size | 35.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Taka Okunishi |
| Maintainers | okunishinishi, realglobe |
| Keywords | ClayDB |

## Links

- npm: https://www.npmjs.com/package/clay-list-pager
- Repository: https://github.com/realglobe-Inc/clay-list-pager
- Homepage: https://github.com/realglobe-Inc/clay-list-pager#readme
- Issues: https://github.com/realglobe-Inc/clay-list-pager/issues
- npm.io page: https://npm.io/package/clay-list-pager

## Dependencies (1)

- [asenv](https://npm.io/package/asenv.md) ^3.0.0

## Recent versions

- 3.0.1 (latest) — 2018-08-12
- 2.1.1 — 2017-11-18
- 2.0.2 — 2017-07-11
- 2.0.1 — 2017-04-05

## README

clay-list-pager
==========

<!---
This file is generated by ape-tmpl. Do not update manually.
--->

<!-- Badge Start -->
<a name="badges"></a>

[![Build Status][bd_travis_shield_url]][bd_travis_url]
[![npm Version][bd_npm_shield_url]][bd_npm_url]
[![JS Standard][bd_standard_shield_url]][bd_standard_url]

[bd_repo_url]: https://github.com/realglobe-Inc/clay-list-pager
[bd_travis_url]: http://travis-ci.org/realglobe-Inc/clay-list-pager
[bd_travis_shield_url]: http://img.shields.io/travis/realglobe-Inc/clay-list-pager.svg?style=flat
[bd_travis_com_url]: http://travis-ci.com/realglobe-Inc/clay-list-pager
[bd_travis_com_shield_url]: https://api.travis-ci.com/realglobe-Inc/clay-list-pager.svg?token=
[bd_license_url]: https://github.com/realglobe-Inc/clay-list-pager/blob/master/LICENSE
[bd_codeclimate_url]: http://codeclimate.com/github/realglobe-Inc/clay-list-pager
[bd_codeclimate_shield_url]: http://img.shields.io/codeclimate/github/realglobe-Inc/clay-list-pager.svg?style=flat
[bd_codeclimate_coverage_shield_url]: http://img.shields.io/codeclimate/coverage/github/realglobe-Inc/clay-list-pager.svg?style=flat
[bd_gemnasium_url]: https://gemnasium.com/realglobe-Inc/clay-list-pager
[bd_gemnasium_shield_url]: https://gemnasium.com/realglobe-Inc/clay-list-pager.svg
[bd_npm_url]: http://www.npmjs.org/package/clay-list-pager
[bd_npm_shield_url]: http://img.shields.io/npm/v/clay-list-pager.svg?style=flat
[bd_standard_url]: http://standardjs.com/
[bd_standard_shield_url]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg

<!-- Badge End -->


<!-- Description Start -->
<a name="description"></a>

List pager for ClayDB

<!-- Description End -->


<!-- Overview Start -->
<a name="overview"></a>



<!-- Overview End -->


<!-- Sections Start -->
<a name="sections"></a>

<!-- Section from "doc/guides/01.Installation.md.hbs" Start -->

<a name="section-doc-guides-01-installation-md"></a>

Installation
-----

```bash
$ npm install clay-list-pager --save
```


<!-- Section from "doc/guides/01.Installation.md.hbs" End -->

<!-- Section from "doc/guides/02.Usage.md.hbs" Start -->

<a name="section-doc-guides-02-usage-md"></a>

Usage
---------

```javascript
'use strict'

const { paginateArray } = require('clay-list-pager')

{
  let array = [ { id: 1 }, { id: 2 }, { id: 3 } ]
  let page = { number: 2, size: 2 }
  let paginated = paginateArray(array, page)

  console.log(paginated) // -> [ { id: 3 } ]
}
```


<!-- Section from "doc/guides/02.Usage.md.hbs" End -->

<!-- Section from "doc/guides/03.Functions.md.hbs" Start -->

<a name="section-doc-guides-03-functions-md"></a>

Functions
---------

Available functions

| Signature | Description |
| ---- | ----------- |
| `metaToPage() -> Object` | Convert clay collection meta object into page |
| `pageToOffsetLimit(page, page.number, page.size) -> Object` | Convert page into offset/limit |
| `paginateArray(array, page, page.number, page.size) -> Object[]` | Paginate array with paging condition |


<!-- Section from "doc/guides/03.Functions.md.hbs" End -->


<!-- Sections Start -->


<!-- LICENSE Start -->
<a name="license"></a>

License
-------
This software is released under the [Apache-2.0 License](https://github.com/realglobe-Inc/clay-list-pager/blob/master/LICENSE).

<!-- LICENSE End -->


<!-- Links Start -->
<a name="links"></a>

Links
------

+ [ClayDB][clay_d_b_url]
+ [Realglobe, Inc.][realglobe,_inc__url]

[clay_d_b_url]: https://github.com/realglobe-Inc/claydb
[realglobe,_inc__url]: http://realglobe.jp

<!-- Links End -->

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