0.1.3 • Published 4 years ago
arpa-js
Licence
MIT
Version
0.1.3
Deps
0
Size
2 kB
Vulns
0
Weekly
0
Arpa
Arpa is Array Pagination for Javascript Project. Can be used for backend and frontend.
- Easy to use
- Lightweight
Install
To install Arpa
npm i arpa-js --save
Usage
Already tested on express and react projects
| Parameter | Type | Description |
|---|---|---|
data |
array |
Required. Your data array |
limit |
number |
Required. Array limit of page |
page |
number |
Required. Page of pagination |
import arpa from 'arpa-js';
const array = [
{
id: 1,
title: 'yellow',
body: 'yellow body',
},
{
id: 2,
title: 'blue',
body: 'blue body',
},
{
id: 3,
title: 'green',
body: 'green body',
},
{
id: 4,
title: 'black',
body: 'black body',
},
];
const example = arpa({ data: array, limit: 2, page: 1 });
console.log(example);