{"_id":"@edjur/kysely-paginate","name":"@edjur/kysely-paginate","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@edjur/kysely-paginate","version":"1.0.0","description":"Pagination helpers for use with kysely (FORK)","repository":{"type":"git","url":"git://github.com/EDjur/kysely-paginate.git"},"author":{"name":"Elias Djurfeldt","email":"eliasdjurfeldt@gmail.com"},"license":"MIT","engines":{"node":">= 16.14.0"},"main":"dist/index.js","module":"dist/index.mjs","types":"dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"require":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"default":"./dist/index.js"}},"scripts":{"build":"tsup src/index.ts --format cjs,esm --dts --clean","release":"pnpm run build && pnpm changeset publish","publish":"npm publish --access public","bench":"vitest bench","lint":"eslint .","test":"vitest","type-check":"tsc --noEmit"},"devDependencies":{"@changesets/cli":"^2.29.8","@eslint/js":"^9.39.2","@faker-js/faker":"^10.2.0","@types/better-sqlite3":"^7.6.13","@types/node":"^25.1.0","@types/pg":"^8.16.0","@typescript-eslint/eslint-plugin":"^8.54.0","@typescript-eslint/parser":"^8.54.0","better-sqlite3":"^12.6.2","eslint":"^9.39.2","eslint-config-prettier":"^10.1.8","eslint-plugin-prettier":"^5.5.5","kysely":"^0.28.10","mysql2":"^3.16.2","pg":"^8.17.2","prettier":"^3.8.1","tsup":"^8.5.1","typescript":"^5.9.3","typescript-eslint":"^8.54.0","vitest":"^4.0.18","zod":"^4.3.6"},"peerDependencies":{"kysely":"*"},"gitHead":"2b613dbb679a8973be680883f362e213895d15ff","_id":"@edjur/kysely-paginate@1.0.0","bugs":{"url":"https://github.com/EDjur/kysely-paginate/issues"},"homepage":"https://github.com/EDjur/kysely-paginate#readme","_nodeVersion":"24.12.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-74ElmcVMJOmV6MwGZ7V0gfvYxH49X7i96zAYaCNnVCdDPQUAbAU7v9TT5KUjB7O2z7QUL9Qer28K1hlOPGiEEg==","shasum":"2e2cf84c4ad310b4f9bd29e49a55454a6a3db015","tarball":"https://registry.npmjs.org/@edjur/kysely-paginate/-/kysely-paginate-1.0.0.tgz","fileCount":7,"unpackedSize":29916,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIC7urQiftAymUccfxD7UIELn0jUDkB2+lNa4xbCDGbecAiEA44D+Nf/QpB3mPgpJIAWO4ZUThs3OVO+6H0yKwiPshC8="}]},"_npmUser":{"name":"edjur","email":"eliasdjurfeldt@gmail.com"},"directories":{},"maintainers":[{"name":"edjur","email":"eliasdjurfeldt@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/kysely-paginate_1.0.0_1769769042904_0.31185798362076844"},"_hasShrinkwrap":false}},"time":{"created":"2026-01-30T10:30:42.828Z","1.0.0":"2026-01-30T10:30:43.080Z","modified":"2026-01-30T10:30:43.428Z"},"maintainers":[{"name":"edjur","email":"eliasdjurfeldt@gmail.com"}],"description":"Pagination helpers for use with kysely (FORK)","homepage":"https://github.com/EDjur/kysely-paginate#readme","repository":{"type":"git","url":"git://github.com/EDjur/kysely-paginate.git"},"author":{"name":"Elias Djurfeldt","email":"eliasdjurfeldt@gmail.com"},"bugs":{"url":"https://github.com/EDjur/kysely-paginate/issues"},"license":"MIT","readme":"# kysely-paginate\nPagination helpers for use with [Kysely](https://github.com/kysely-org/kysely).\n\n> :warning: **This is a work in progress!** This library is still very early in development. Things won't work, things will be missing, and there will be breaking changes.\n\n## Cursor pagination\n```ts\nconst query = db\n  .selectFrom(\"blogPosts\")\n  .select([\"id\", \"title\", \"body\", \"authorId\"])\n  .where(\"authorId\", \"=\", 1);\n\nconst result = await executeWithCursorPagination(query, {\n  perPage: 10,\n  fields: [\n    { expression: \"title\", direction: \"desc\" },\n    { expression: \"id\", direction: \"asc\" },\n  ],\n  parseCursor: (cursor) => ({\n    title: cursor.title,\n    id: parseInt(cursor.id, 10),\n  }),\n});\n```\n\n## Offset pagination\n```ts\nconst query = db\n  .selectFrom(\"blogPosts\")\n  .select([\"id\", \"title\", \"body\", \"authorId\"])\n  .where(\"authorId\", \"=\", 1)\n  .orderBy(\"title\", \"desc\")\n  .orderBy(\"id\", \"asc\");\n\nconst result = await executeWithOffsetPagination(query, {\n  perPage: 10,\n  page: 1,\n})\n```\n","readmeFilename":"README.md","_rev":"1-1045350d81a47de43380bbd0362c9f0d"}