Gathering detailed insights and metrics for typeorm-paginator
Gathering detailed insights and metrics for typeorm-paginator
Gathering detailed insights and metrics for typeorm-paginator
Gathering detailed insights and metrics for typeorm-paginator
TypeORM query builder pagination library. (cursor / page both)
npm install typeorm-paginator
Typescript
Module System
Node Version
NPM Version
TypeScript (99.3%)
JavaScript (0.7%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
3 Stars
145 Commits
3 Forks
1 Watchers
8 Branches
3 Contributors
Updated on Feb 11, 2022
Latest Version
0.6.2
Package Id
typeorm-paginator@0.6.2
Unpacked Size
182.40 kB
Size
18.11 kB
File Count
30
NPM Version
7.21.0
Node Version
14.17.5
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
It provides cursor-based pagination and page-based pagination. Even if there is a transformer in the column, it works perfectly.
1npm install typeorm-paginator --save
1import { CursorPaginator } from 'typeorm-paginator'
Single cursor-based pagination.
1const paginator = new CursorPaginator(User, { 2 orderBy: { 3 id: false, 4 }, 5}) 6 7const pagination = await paginator.paginate(repoUsers.createQueryBuilder()) 8 9expect(pagination).toEqual({ 10 nodes: [ 11 /* 12 User { id: 3 }, 13 User { id: 2 }, 14 User { id: 1 }, 15 */ 16 ], 17 hasPrev: false, 18 hasNext: false, 19 nextCursor: expect.any(String), 20 prevCursor: expect.any(String), 21})
Multi cursor-based pagination.
1const paginator = new CursorPaginator(User, { 2 orderBy: [ 3 { name: true }, 4 { id: false }, 5 ], 6}) 7 8const result = await paginator.paginate(repoUsers.createQueryBuilder(), { take: 2 }) 9expect(result).toEqual({ 10 nodes: [ 11 User { id: 3, name: 'a' }, 12 User { id: 5, name: 'b' }, 13 ], 14 hasPrev: false, 15 hasNext: true, 16 prevCursor: expect.any(String), 17 nextCursor: expect.any(String), 18}) 19 20const resultNext = await paginator.paginate(repoUsers.createQueryBuilder(), { take: 2, nextCursor: result.nextCursor }) 21expect(resultNext).toEqual({ 22 nodes: [ 23 User { id: 2, name: 'b' }, 24 User { id: 6, name: 'c' }, 25 ], 26 hasPrev: true, 27 hasNext: true, 28 prevCursor: expect.any(String), 29 nextCursor: expect.any(String), 30}) 31 32const resultNextNext = await paginator.paginate(repoUsers.createQueryBuilder(), { take: 2, nextCursor: resultNext.nextCursor }) 33expect(resultNextNext).toEqual({ 34 nodes: [ 35 User { id: 4, name: 'c' }, 36 User { id: 1, name: 'c' }, 37 ], 38 hasPrev: true, 39 hasNext: false, 40 prevCursor: expect.any(String), 41 nextCursor: expect.any(String), 42}) 43 44const resultNextNextPrev = await paginator.paginate(repoUsers.createQueryBuilder(), { take: 2, prevCursor: resultNextNext.prevCursor }) 45expect(resultNextNextPrev).toEqual({ 46 nodes: [ 47 User { id: 2, name: 'b' }, 48 User { id: 6, name: 'c' }, 49 ], 50 hasPrev: true, 51 hasNext: true, 52 prevCursor: expect.any(String), 53 nextCursor: expect.any(String), 54})
1import { PagePaginator } from 'typeorm-paginator'
Single cursor-based pagination.
1const paginator = new PagePaginator(User, { 2 orderBy: { 3 id: false, 4 }, 5 take: 3, 6}) 7 8const pagination1 = await paginator.paginate(repoUsers.createQueryBuilder()) 9 10expect(pagination1).toEqual({ 11 nodes: [ 12 /* 13 User { id: 5 }, 14 User { id: 4 }, 15 User { id: 3 }, 16 */ 17 ], 18 hasNext: true, 19}) 20 21const pagination1 = await paginator.paginate(repoUsers.createQueryBuilder(), { page: 2 }) 22 23expect(pagination1).toEqual({ 24 nodes: [ 25 /* 26 User { id: 2 }, 27 User { id: 1 }, 28 */ 29 ], 30 hasNext: false, 31})
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
dependency not pinned by hash detected -- score normalized to 3
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 1/29 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
license file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
26 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn Moretypeorm-paginator-nest
Provide pagination for typeorm
nest-typeorm-paginator
<p align="center"> <a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo_text.svg" width="320" alt="Nest Logo" /></a> </p>
nest-paginator
Paginating data with NestJS and TypeORM
typeorm-cursor-paginate
Cursor-based pagination with directional cursors.