Simple, dependency-free pagination component.
npm i @fiquu/pagination
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);
Please see the documentation page for more details.