{"_id":"prisma-cursorstream","_rev":"7-f48210861055cbc44b54700fb120cb97","name":"prisma-cursorstream","dist-tags":{"latest":"0.4.2"},"versions":{"0.1.0":{"name":"prisma-cursorstream","version":"0.1.0","keywords":["prisma-extension","prisma-client","prisma","streams"],"author":{"url":"https://www.aularon.com/","name":"Hasan Arous","email":"hasan.arous@gmail.com"},"license":"MIT","_id":"prisma-cursorstream@0.1.0","maintainers":[{"name":"aularon","email":"arous.hasan@gmail.com"}],"dist":{"shasum":"1e0ea39522c73671567610f135022cc314ad9976","tarball":"https://registry.npmjs.org/prisma-cursorstream/-/prisma-cursorstream-0.1.0.tgz","fileCount":5,"integrity":"sha512-yeNsUWe4pmpktL3qxzObsOFyZB7JmAF+SayeSo3hlokN8AHws252oqb4NMAckr3fCcj2CnLmnqgX9oo9IN8FjQ==","signatures":[{"sig":"MEUCIQDLD25gOSz8SJi8FQ5Mixcf+l8J4Zto2UUvDWLYtHiMlAIgHftZbwmNswRYZDAf384eXwv0rhEYVsBZOllcfVgKuTc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":7370},"main":"./dist/index.js","_from":"file:prisma-cursorstream-0.1.0.tgz","types":"./dist/index.d.ts","scripts":{},"_npmUser":{"name":"aularon","email":"arous.hasan@gmail.com"},"_resolved":"/tmp/030eb8e1b2dbd4970e57a7c578984994/prisma-cursorstream-0.1.0.tgz","_integrity":"sha512-yeNsUWe4pmpktL3qxzObsOFyZB7JmAF+SayeSo3hlokN8AHws252oqb4NMAckr3fCcj2CnLmnqgX9oo9IN8FjQ==","_npmVersion":"8.11.0","description":"Prisma Stream Client Extension (Cursor-based Implementation)","directories":{},"_nodeVersion":"18.3.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.1.6","@types/node":"^20.5.1","@prisma/client":"^5.1.1"},"peerDependencies":{"@prisma/client":"^5.1.1"},"_npmOperationalInternal":{"tmp":"tmp/prisma-cursorstream_0.1.0_1692701586761_0.781617740752697","host":"s3://npm-registry-packages"}},"0.1.1":{"name":"prisma-cursorstream","version":"0.1.1","keywords":["prisma-extension","prisma-client","prisma","streams"],"author":{"url":"https://www.aularon.com/","name":"Hasan Arous","email":"hasan.arous@gmail.com"},"license":"MIT","_id":"prisma-cursorstream@0.1.1","maintainers":[{"name":"aularon","email":"arous.hasan@gmail.com"}],"homepage":"https://github.com/etabits/prisma-cursorstream#readme","bugs":{"url":"https://github.com/etabits/prisma-cursorstream/issues"},"dist":{"shasum":"0c3eb5536bd36c3c975c1ae2ff7e42cdac31c671","tarball":"https://registry.npmjs.org/prisma-cursorstream/-/prisma-cursorstream-0.1.1.tgz","fileCount":5,"integrity":"sha512-5mYUOOaqH+XFcqeoPTADxegC9XgfW0G8tXZZJuYa817M4jO4o9FWPDOLw4FjM6nAVZw/pbz8tz8pWBhBjzZSbQ==","signatures":[{"sig":"MEQCIDtqzaJ0jzXwV1rl7C+Utx9DQU43sAhOKhm3xKm4o4W1AiAy4CcX4EKT5UGDIPCB4hBIDIhwwehqqopI47Z15W7yNA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":7436},"main":"./dist/index.js","_from":"file:prisma-cursorstream-0.1.1.tgz","types":"./dist/index.d.ts","scripts":{},"_npmUser":{"name":"aularon","email":"arous.hasan@gmail.com"},"_resolved":"/tmp/b4dca299363c7a76e6f6c6bd8e8927c5/prisma-cursorstream-0.1.1.tgz","_integrity":"sha512-5mYUOOaqH+XFcqeoPTADxegC9XgfW0G8tXZZJuYa817M4jO4o9FWPDOLw4FjM6nAVZw/pbz8tz8pWBhBjzZSbQ==","repository":{"url":"git+https://github.com/etabits/prisma-cursorstream.git","type":"git"},"_npmVersion":"8.11.0","description":"Prisma Stream Client Extension (Cursor-based Implementation)","directories":{},"_nodeVersion":"18.3.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.1.6","@types/node":"^20.5.1","@prisma/client":"^5.1.1"},"peerDependencies":{"@prisma/client":"^5.1.1"},"_npmOperationalInternal":{"tmp":"tmp/prisma-cursorstream_0.1.1_1692701816940_0.38546352956715446","host":"s3://npm-registry-packages"}},"0.2.0":{"name":"prisma-cursorstream","version":"0.2.0","keywords":["prisma-extension","prisma-client","prisma","streams"],"author":{"url":"https://www.aularon.com/","name":"Hasan Arous","email":"hasan.arous@gmail.com"},"license":"MIT","_id":"prisma-cursorstream@0.2.0","maintainers":[{"name":"aularon","email":"arous.hasan@gmail.com"}],"homepage":"https://github.com/etabits/prisma-cursorstream#readme","bugs":{"url":"https://github.com/etabits/prisma-cursorstream/issues"},"dist":{"shasum":"e454f108bd8b82bc3c6dc31108f6438d8e1d804b","tarball":"https://registry.npmjs.org/prisma-cursorstream/-/prisma-cursorstream-0.2.0.tgz","fileCount":5,"integrity":"sha512-UFYxjZv0S+cv/S3fW8V9nCp58QAwpROle11Wjn8O/E0U7k92Vy9/A232MsB8BQVXD9VjYsrpOj6687np5psqcw==","signatures":[{"sig":"MEUCIGb9eyYRTSb++UuIF1mOGp2uwhTQPhzBcsLbpZysJ1SdAiEAi3w+ojinWEnEOCbHrY1tb58XE+9g54DzRoqoKJcJX8I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":7528},"main":"./dist/index.js","_from":"file:prisma-cursorstream-0.2.0.tgz","types":"./dist/index.d.ts","scripts":{},"_npmUser":{"name":"aularon","email":"arous.hasan@gmail.com"},"_resolved":"/tmp/479a41505d4ec7a089954bf0e6576c7d/prisma-cursorstream-0.2.0.tgz","_integrity":"sha512-UFYxjZv0S+cv/S3fW8V9nCp58QAwpROle11Wjn8O/E0U7k92Vy9/A232MsB8BQVXD9VjYsrpOj6687np5psqcw==","repository":{"url":"git+https://github.com/etabits/prisma-cursorstream.git","type":"git"},"_npmVersion":"8.11.0","description":"Prisma Stream Client Extension (Cursor-based Implementation)","directories":{},"_nodeVersion":"18.3.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.1.6","@types/node":"^20.5.1","@prisma/client":"^5.1.1"},"peerDependencies":{"@prisma/client":"^5.1.1"},"_npmOperationalInternal":{"tmp":"tmp/prisma-cursorstream_0.2.0_1692867881479_0.2631315784775432","host":"s3://npm-registry-packages"}},"0.3.0":{"name":"prisma-cursorstream","version":"0.3.0","keywords":["prisma-extension","prisma-client","prisma","streams"],"author":{"url":"https://www.aularon.com/","name":"Hasan Arous","email":"hasan.arous@gmail.com"},"license":"MIT","_id":"prisma-cursorstream@0.3.0","maintainers":[{"name":"aularon","email":"arous.hasan@gmail.com"}],"homepage":"https://github.com/etabits/prisma-cursorstream#readme","bugs":{"url":"https://github.com/etabits/prisma-cursorstream/issues"},"dist":{"shasum":"45d920c883045542f94d19ce542ec9332d1b6b5c","tarball":"https://registry.npmjs.org/prisma-cursorstream/-/prisma-cursorstream-0.3.0.tgz","fileCount":5,"integrity":"sha512-wfz/oLoke6rPSCC+oMuVT+3fJOR62NVquHWRwik+yPFot4OT+S8COVTRCwHf1pWDjJ9DHyOO4rRj+AtxPK5+6Q==","signatures":[{"sig":"MEQCIEL6KjhKQoHR37KQ7O4yLOnVDW92jpuffJrvALRP9a6ZAiBAoT/z1BI7Avq9NLxZWLt9hAf1/WqUW2ZQ4VfMoHoRdA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":7937},"main":"./dist/index.js","_from":"file:prisma-cursorstream-0.3.0.tgz","types":"./dist/index.d.ts","scripts":{},"_npmUser":{"name":"aularon","email":"arous.hasan@gmail.com"},"_resolved":"/tmp/fb7845ea2321f657e7fbd1a5e1f877a9/prisma-cursorstream-0.3.0.tgz","_integrity":"sha512-wfz/oLoke6rPSCC+oMuVT+3fJOR62NVquHWRwik+yPFot4OT+S8COVTRCwHf1pWDjJ9DHyOO4rRj+AtxPK5+6Q==","repository":{"url":"git+https://github.com/etabits/prisma-cursorstream.git","type":"git"},"_npmVersion":"10.2.3","description":"Prisma Stream Client Extension (Cursor-based Implementation)","directories":{},"_nodeVersion":"20.10.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.1.6","@types/node":"^20.5.1","@prisma/client":"^5.1.1"},"peerDependencies":{"@prisma/client":"^5.1.1"},"_npmOperationalInternal":{"tmp":"tmp/prisma-cursorstream_0.3.0_1706026554715_0.48799681503447356","host":"s3://npm-registry-packages"}},"0.4.0":{"name":"prisma-cursorstream","version":"0.4.0","keywords":["prisma-extension","prisma-client","prisma","streams"],"author":{"url":"https://www.aularon.com/","name":"Hasan Arous","email":"hasan.arous@gmail.com"},"license":"MIT","_id":"prisma-cursorstream@0.4.0","maintainers":[{"name":"aularon","email":"arous.hasan@gmail.com"}],"homepage":"https://github.com/etabits/prisma-cursorstream#readme","bugs":{"url":"https://github.com/etabits/prisma-cursorstream/issues"},"dist":{"shasum":"950118bf97a28d32876da4802adaedb6b2130201","tarball":"https://registry.npmjs.org/prisma-cursorstream/-/prisma-cursorstream-0.4.0.tgz","fileCount":5,"integrity":"sha512-mp6TiyPpM/D5pjsWtQLEFDbhtpuLszp483Qb8n9GoYOZ01qeLYCudWAdC+P3PjsY0bQPMgAZgabkGKNnszfwJQ==","signatures":[{"sig":"MEUCIBa12hLnMFAutHXgC/66H7KgyO4ofd6kDo6/Iwc7Z0Z5AiEA5N6WM2NASz5KZCd5Z4FqDzf2Zdfp3Hb0v2Ajn3nC9V8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":7903},"main":"./dist/index.js","_from":"file:prisma-cursorstream-0.4.0.tgz","types":"./dist/index.d.ts","scripts":{},"_npmUser":{"name":"aularon","email":"arous.hasan@gmail.com"},"_resolved":"/tmp/dea4f3c39bf30a942dfc6bc1e507bcac/prisma-cursorstream-0.4.0.tgz","_integrity":"sha512-mp6TiyPpM/D5pjsWtQLEFDbhtpuLszp483Qb8n9GoYOZ01qeLYCudWAdC+P3PjsY0bQPMgAZgabkGKNnszfwJQ==","repository":{"url":"git+https://github.com/etabits/prisma-cursorstream.git","type":"git"},"_npmVersion":"10.9.0","description":"Prisma Stream Client Extension (Cursor-based Implementation)","directories":{},"_nodeVersion":"22.11.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.1.6","@types/node":"^20.5.1","@prisma/client":"^5.1.1"},"peerDependencies":{"@prisma/client":"^5.1.1 || >= 5.1.1 <= 6.2.x"},"_npmOperationalInternal":{"tmp":"tmp/prisma-cursorstream_0.4.0_1737354221810_0.30710728941791654","host":"s3://npm-registry-packages-npm-production"}},"0.4.1":{"name":"prisma-cursorstream","version":"0.4.1","keywords":["prisma-extension","prisma-client","prisma","streams"],"author":{"url":"https://www.aularon.com/","name":"Hasan Arous","email":"hasan.arous@gmail.com"},"license":"MIT","_id":"prisma-cursorstream@0.4.1","maintainers":[{"name":"aularon","email":"arous.hasan@gmail.com"}],"homepage":"https://github.com/etabits/prisma-cursorstream#readme","bugs":{"url":"https://github.com/etabits/prisma-cursorstream/issues"},"dist":{"shasum":"2aae122c558367fef4f1c02d14bc14ef6840ef8a","tarball":"https://registry.npmjs.org/prisma-cursorstream/-/prisma-cursorstream-0.4.1.tgz","fileCount":5,"integrity":"sha512-0cHd3eTOHSKeBxc47M9pzS9g0U4ubjv6SU1WO86ROqFLw9YY88wN8yqPtKXUWxTTUMiSX6D/X9TavqHZDppoDw==","signatures":[{"sig":"MEQCIAgE/zx0DPW4yl47vrSQQiM5s1acdYcnHPCDD5uTiSK4AiABcza7hMHr2/+38mkDFh/KtwHOfePcHI7E/mrSkh1uaQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":7888},"main":"./dist/index.js","_from":"file:prisma-cursorstream-0.4.1.tgz","types":"./dist/index.d.ts","scripts":{},"_npmUser":{"name":"aularon","actor":{"name":"aularon","type":"user","email":"arous.hasan@gmail.com"},"email":"arous.hasan@gmail.com"},"_resolved":"/tmp/e16eca0b6fb9342acc93bc9b39876e09/prisma-cursorstream-0.4.1.tgz","_integrity":"sha512-0cHd3eTOHSKeBxc47M9pzS9g0U4ubjv6SU1WO86ROqFLw9YY88wN8yqPtKXUWxTTUMiSX6D/X9TavqHZDppoDw==","repository":{"url":"git+https://github.com/etabits/prisma-cursorstream.git","type":"git"},"_npmVersion":"10.9.0","description":"Prisma Stream Client Extension (Cursor-based Implementation)","directories":{},"_nodeVersion":"22.11.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.1.6","@types/node":"^20.5.1","@prisma/client":"^5.1.1"},"peerDependencies":{"@prisma/client":">= 5.1.1 < 7"},"_npmOperationalInternal":{"tmp":"tmp/prisma-cursorstream_0.4.1_1751692724698_0.5358258376774234","host":"s3://npm-registry-packages-npm-production"}},"0.4.2":{"name":"prisma-cursorstream","version":"0.4.2","description":"Prisma Stream Client Extension (Cursor-based Implementation)","main":"./dist/index.js","types":"./dist/index.d.ts","repository":{"type":"git","url":"git+https://github.com/etabits/prisma-cursorstream.git"},"keywords":["prisma-extension","prisma-client","prisma","streams"],"author":{"name":"Hasan Arous","email":"hasan.arous@gmail.com","url":"https://www.aularon.com/"},"license":"MIT","devDependencies":{"@prisma/client":"^5.1.1","@types/node":"^20.5.1","typescript":"^5.1.6"},"peerDependencies":{"@prisma/client":">= 5.1.1 < 8"},"scripts":{},"_id":"prisma-cursorstream@0.4.2","bugs":{"url":"https://github.com/etabits/prisma-cursorstream/issues"},"homepage":"https://github.com/etabits/prisma-cursorstream#readme","_integrity":"sha512-Xgpd9LvU+P2f2vp+GOC/R+bPLOG8fnIdrVcbQFFtqdrfVjt9cKBzvl3Dc+xVnG0787ON6xdXDywqezYSVHKxEw==","_resolved":"/tmp/80b5850be5d8dc6c5f78226e1d02079e/prisma-cursorstream-0.4.2.tgz","_from":"file:prisma-cursorstream-0.4.2.tgz","_nodeVersion":"24.8.0","_npmVersion":"11.6.0","dist":{"integrity":"sha512-Xgpd9LvU+P2f2vp+GOC/R+bPLOG8fnIdrVcbQFFtqdrfVjt9cKBzvl3Dc+xVnG0787ON6xdXDywqezYSVHKxEw==","shasum":"9624e943e88db106d0188d1c6439fb968ca28008","tarball":"https://registry.npmjs.org/prisma-cursorstream/-/prisma-cursorstream-0.4.2.tgz","fileCount":5,"unpackedSize":7852,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDwiO2YeP19s6pBaD7GcSC8f8C4gu82mrizYz2clTi+/QIgImbhUNUHGTw50/rgTFFGIlRHf/SJmYRBDY76q26IRyo="}]},"_npmUser":{"name":"aularon","email":"arous.hasan@gmail.com"},"directories":{},"maintainers":[{"name":"aularon","email":"arous.hasan@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/prisma-cursorstream_0.4.2_1766419529664_0.739193490801876"},"_hasShrinkwrap":false}},"time":{"created":"2023-08-22T10:53:06.761Z","modified":"2025-12-22T16:05:30.038Z","0.1.0":"2023-08-22T10:53:06.927Z","0.1.1":"2023-08-22T10:56:57.170Z","0.2.0":"2023-08-24T09:04:41.653Z","0.3.0":"2024-01-23T16:15:54.904Z","0.4.0":"2025-01-20T06:23:41.977Z","0.4.1":"2025-07-05T05:18:44.875Z","0.4.2":"2025-12-22T16:05:29.832Z"},"bugs":{"url":"https://github.com/etabits/prisma-cursorstream/issues"},"author":{"name":"Hasan Arous","email":"hasan.arous@gmail.com","url":"https://www.aularon.com/"},"license":"MIT","homepage":"https://github.com/etabits/prisma-cursorstream#readme","keywords":["prisma-extension","prisma-client","prisma","streams"],"repository":{"type":"git","url":"git+https://github.com/etabits/prisma-cursorstream.git"},"description":"Prisma Stream Client Extension (Cursor-based Implementation)","maintainers":[{"name":"aularon","email":"arous.hasan@gmail.com"}],"readme":"# prisma-cursorstream\n\nPrisma Stream Client Extension (Cursor-based Implementation)\n\n## Features\n\n- Clean API (`for await`)\n- Fully typed <img src=\"https://www.typescriptlang.org/favicon-32x32.png\" height=\"16\" width=\"16\" alt=\"\" />\n- Minimal implementation. The [source](https://github.com/etabits/prisma-cursorstream/blob/main/src/index.ts) itself is well below 100 LOCs.\n\n## Installation & Activation\n\n```sh\nnpm install prisma-cursorstream\n```\n\nThen, extend your prisma client like this:\n\n```js\nimport { PrismaClient } from \"@prisma/client\";\nimport cursorStream from \"prisma-cursorstream\";\n\nconst db = new PrismaClient().$extends(cursorStream);\n```\n\n<details>\n<summary>Using CommonJS `require`?</summary>\n\n### CommonJS `require`\n\n```js\nconst cursorStream = require(\"prisma-cursorstream\").default;\n\nconst db = new PrismaClient().$extends(cursorStream);\n```\n\nRefer to [#1](https://github.com/etabits/prisma-cursorstream/issues/1).\n\n</details>\n\n## Usage\n\n```js\nconst stream = db.post.cursorStream({\n  // Your usual findMany args\n  select: {\n    id: true,\n    title: true,\n  },\n  where: {\n    published: true,\n  },\n});\nfor await (const post of stream) {\n  console.log(post); // {id: 1, title: 'Hello!'}\n}\n```\n\n## Advanced API\n\nThe following options (passed as a second argument) provide additional controls over the streaming process.\n\n- **Batch size**: `batchSize` specifies how many rows are fetched each batch. Defaults to `100`\n- **Pre-fill size**: Since the streaming happens asynchronously, it may be useful to fetch more rows well before current batch is completely consumed. `prefill` specifies the internal `highWaterMark` of the `Readable` stream. Defaults to double the batch size (usually `200`).\n- **Batch transformation**: Sometimes you may need to pre-process the resulting rows in batches before they are consumed. This is where the `batchTransformer` comes in. If provided, it receives an array of the last fetched batch of rows, can operate on them asynchronously, and then return an array of transformed rows to be consumed instead. Types are properly handled.\n\n```js\nconst stream = db.post.cursorStream(\n  {\n    where: {\n      published: true,\n    },\n  },\n  {\n    batchSize: 42, // batches of 42 posts at a time\n    prefill: 69, // prefetch up to 69+ posts\n    async batchTransformer(posts) {\n      const translations = await translate(posts.map((p) => p.title));\n      return posts.map((p, i) => ({\n        ...p,\n        translatedTitle: translations[i],\n      }));\n    },\n  }\n);\n\nfor await (const translatedPost of stream) {\n  console.log(translatedPost); // {..., translatedTitle: \"مرحبا!\"}\n}\n```\n","readmeFilename":"README.md"}