@fiquu/pagination
v1.0.5
Published
Simple pagination component.
Downloads
6
Readme
@fiquu/pagination
Simple, dependency-free pagination component.
Installation
npm i @fiquu/pagination
Usage
import { createPagination, PaginationComponent } from '@fiquu/pagination';
const pagination: PaginationComponent = createPagination({ limit: 50 });
const { limit, skip } = pagination.paginate(3); // limit = 50; skip = 100;
// Or in some query...
const query = await Posts.find()
.skip(pagination.skip(req.query.page))
.limit(pagination.limit);
Documentation
Please see the documentation page for more details.