{"_id":"@belfed/koemment","_rev":"5-3594cb3c126d0ba226e6f51f978db6f5","name":"@belfed/koemment","dist-tags":{"latest":"0.4.0"},"versions":{"0.1.1":{"name":"@belfed/koemment","version":"0.1.1","author":"belfed","license":"MIT","_id":"@belfed/koemment@0.1.1","maintainers":[{"name":"belfed","email":"federicobelotti96@gmail.com"}],"homepage":"https://github.com/belfed/koemment#readme","bugs":{"url":"https://github.com/belfed/koemment/issues"},"dist":{"shasum":"920fa1cefb8487d3163067b7ba28faa7c8e13eee","tarball":"https://registry.npmjs.org/@belfed/koemment/-/koemment-0.1.1.tgz","fileCount":4,"integrity":"sha512-r9taM2PcVbn5UuougMlqVn9VqKqDPdNVkFr42UWOUz0eXsvDMLDMeuggCdly0MSreRCsLGyPDbPZW9El9TTgAA==","signatures":[{"sig":"MEYCIQCtM1K1UDRyekIUcwTWymojSNhJCSFVm+7hx9/rrrsTCwIhANQaPeMGW/sONnCH41Rf9krSBFC3LJ/EzelNJcy7oH7K","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":38636},"type":"module","exports":{".":"./dist/index.mjs","./package.json":"./package.json"},"scripts":{"dev":"tsdown --watch","test":"vitest","build":"tsdown","typecheck":"tsc --noEmit"},"_npmUser":{"name":"belfed","email":"federicobelotti96@gmail.com"},"repository":{"url":"git+https://github.com/belfed/koemment.git","type":"git"},"description":"Client for reading and writing comments via the koemment API.","directories":{},"_nodeVersion":"22.20.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsdown":"^0.22.5","vitest":"^4.1.10","@belfed/db":"0.2.0","typescript":"^7.0.2","@types/node":"^26.1.1"},"inlinedDependencies":{"@prisma/client":"7.9.1","@prisma/client-runtime-utils":"7.9.1"},"_npmOperationalInternal":{"tmp":"tmp/koemment_0.1.1_1787735781279_0.29400356330253175","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@belfed/koemment","version":"0.2.0","author":"belfed","license":"MIT","_id":"@belfed/koemment@0.2.0","maintainers":[{"name":"belfed","email":"federicobelotti96@gmail.com"}],"homepage":"https://github.com/belfed/koemment#readme","bugs":{"url":"https://github.com/belfed/koemment/issues"},"dist":{"shasum":"250f401124a6dc26ce1889765319370350afa611","tarball":"https://registry.npmjs.org/@belfed/koemment/-/koemment-0.2.0.tgz","fileCount":4,"integrity":"sha512-tMo6r6rnY4mi0DTPh+tYh2t/hlZ+pweUW1HDcm2dUYLDvaj1WPdeKdMdSAcoVl2n3FgzSffRo7hDU4zBCC80Yg==","signatures":[{"sig":"MEUCIFr2bg4349y3gJc5Rct/zt7GvCEZVuEJYqXY2Cz1JPj/AiEAp2U1uwF6wZeZU4iqUdWlMbCdoQSrGgt9tk4OsgFSstg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":40053},"type":"module","exports":{".":"./dist/index.mjs","./package.json":"./package.json"},"scripts":{"dev":"tsdown --watch","test":"vitest","build":"tsdown","typecheck":"tsc --noEmit"},"_npmUser":{"name":"belfed","email":"federicobelotti96@gmail.com"},"repository":{"url":"git+https://github.com/belfed/koemment.git","type":"git"},"description":"Client for reading and writing comments via the koemment API.","directories":{},"_nodeVersion":"22.20.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsdown":"^0.22.5","vitest":"^4.1.10","@belfed/db":"0.2.0","typescript":"^7.0.2","@types/node":"^26.1.1"},"inlinedDependencies":{"@prisma/client":"7.9.1","@prisma/client-runtime-utils":"7.9.1"},"_npmOperationalInternal":{"tmp":"tmp/koemment_0.2.0_1787737158817_0.9681129424362684","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@belfed/koemment","version":"0.2.1","author":"belfed","license":"MIT","_id":"@belfed/koemment@0.2.1","maintainers":[{"name":"belfed","email":"federicobelotti96@gmail.com"}],"homepage":"https://github.com/belfed/koemment#readme","bugs":{"url":"https://github.com/belfed/koemment/issues"},"dist":{"shasum":"1574c96b73c64445dd145270ac523b623de1250b","tarball":"https://registry.npmjs.org/@belfed/koemment/-/koemment-0.2.1.tgz","fileCount":4,"integrity":"sha512-IqApCUatTKLiA/073oJauNGTHyepYlsHFD/S0pSCBCbO3eoujJN8et80i100cGoBgXWm0tXL/Lob8fAU8KSBSg==","signatures":[{"sig":"MEQCICebcFqOovyprxn+bTSgdoLmeIaedoxvAqOI/1gelbBdAiAWEiVK04M8H45Fl50VA50280yhnkhZv7yqVCQVXJ8iLw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":40224},"type":"module","exports":{".":"./dist/index.mjs","./package.json":"./package.json"},"scripts":{"dev":"tsdown --watch","test":"vitest","build":"tsdown","typecheck":"tsc --noEmit"},"_npmUser":{"name":"belfed","email":"federicobelotti96@gmail.com"},"repository":{"url":"git+https://github.com/belfed/koemment.git","type":"git"},"description":"Client for reading and writing comments via the koemment API.","directories":{},"_nodeVersion":"22.20.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsdown":"^0.22.5","vitest":"^4.1.10","@belfed/db":"0.2.0","typescript":"^7.0.2","@types/node":"^26.1.1"},"inlinedDependencies":{"@prisma/client":"7.9.1","@prisma/client-runtime-utils":"7.9.1"},"_npmOperationalInternal":{"tmp":"tmp/koemment_0.2.1_1787740058827_0.20220903159101766","host":"s3://npm-registry-packages-npm-production"}},"0.3.1":{"name":"@belfed/koemment","version":"0.3.1","author":"belfed","license":"MIT","_id":"@belfed/koemment@0.3.1","maintainers":[{"name":"belfed","email":"federicobelotti96@gmail.com"}],"homepage":"https://github.com/belfed/koemment#readme","bugs":{"url":"https://github.com/belfed/koemment/issues"},"dist":{"shasum":"61e4c8703ffbbd3eeae091cf9eee51a80d5836b9","tarball":"https://registry.npmjs.org/@belfed/koemment/-/koemment-0.3.1.tgz","fileCount":4,"integrity":"sha512-gtTMgKwlHVlTEohPmaKf2ib1pZVyaUP1DyReun4+2ktV0gL37TmUkBnopB9MLTBkEj9xRnP9OqK2+qBGrEvVtA==","signatures":[{"sig":"MEUCIFC3X4P3WEbTBQwEDKzSXHLKiHTOmsYHnBNExdoPwVPfAiEAoDBvhekyNqVdGk+7NQXOwIhvbMegNh5st0dnVYzefh4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":40912},"type":"module","exports":{".":"./dist/index.mjs","./package.json":"./package.json"},"scripts":{"dev":"tsdown --watch","test":"vitest","build":"tsdown","typecheck":"tsc --noEmit"},"_npmUser":{"name":"belfed","email":"federicobelotti96@gmail.com"},"repository":{"url":"git+https://github.com/belfed/koemment.git","type":"git"},"description":"Client for reading and writing comments via the koemment API.","directories":{},"_nodeVersion":"22.20.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsdown":"^0.22.5","vitest":"^4.1.10","@belfed/db":"0.2.0","typescript":"^7.0.2","@types/node":"^26.1.1"},"inlinedDependencies":{"@prisma/client":"7.9.1","@prisma/client-runtime-utils":"7.9.1"},"_npmOperationalInternal":{"tmp":"tmp/koemment_0.3.1_1787754381070_0.7432163877045939","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@belfed/koemment","type":"module","version":"0.4.0","description":"Client for reading and writing comments via the koemment API.","author":"belfed","license":"MIT","homepage":"https://github.com/belfed/koemment#readme","repository":{"type":"git","url":"git+https://github.com/belfed/koemment.git"},"bugs":{"url":"https://github.com/belfed/koemment/issues"},"publishConfig":{"access":"public"},"exports":{".":"./dist/index.mjs","./package.json":"./package.json"},"devDependencies":{"@types/node":"^26.1.1","tsdown":"^0.22.5","typescript":"^7.0.2","vitest":"^4.1.10","@belfed/db":"0.2.0"},"inlinedDependencies":{"@prisma/client":"7.9.1","@prisma/client-runtime-utils":"7.9.1"},"scripts":{"build":"tsdown","dev":"tsdown --watch","test":"vitest","typecheck":"tsc --noEmit"},"_nodeVersion":"22.20.0","_id":"@belfed/koemment@0.4.0","dist":{"integrity":"sha512-0MfpLlk70+bvtUikX0B4ZiZy7N1qUgPogxZAGs4cMF32yDbNPqrVdc0x5n+3EXlLpvhhxOZ4A37i4r/sDO1G/A==","shasum":"14134d9174c8eaa33cbd34f4ffeba03b25d722cf","tarball":"https://registry.npmjs.org/@belfed/koemment/-/koemment-0.4.0.tgz","fileCount":4,"unpackedSize":41172,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCRxgwSrf+w6jRhQGRMstCfLCabq+5A8p01PqAIWL+TSAIgK3k5fbdNgj9MKC1L/HSlhBAhQnRq80SsarnT6tVqPdw="}]},"_npmUser":{"name":"belfed","email":"federicobelotti96@gmail.com"},"directories":{},"maintainers":[{"name":"belfed","email":"federicobelotti96@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/koemment_0.4.0_1787758415219_0.6758483987583315"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-26T09:16:21.142Z","modified":"2026-08-26T15:33:35.514Z","0.1.1":"2026-08-26T09:16:21.416Z","0.2.0":"2026-08-26T09:39:18.952Z","0.2.1":"2026-08-26T10:27:38.960Z","0.3.1":"2026-08-26T14:26:21.396Z","0.4.0":"2026-08-26T15:33:35.359Z"},"bugs":{"url":"https://github.com/belfed/koemment/issues"},"author":"belfed","license":"MIT","homepage":"https://github.com/belfed/koemment#readme","repository":{"type":"git","url":"git+https://github.com/belfed/koemment.git"},"description":"Client for reading and writing comments via the koemment API.","maintainers":[{"name":"belfed","email":"federicobelotti96@gmail.com"}],"readme":"# @belfed/koemment\r\n\r\nClient for reading and writing comments via the [koemment](https://github.com/belfed/koemment) API.\r\n\r\n## Install\r\n\r\n```bash\r\nnpm install @belfed/koemment\r\n```\r\n\r\n## Usage\r\n\r\n```ts\r\nimport { KoemmentClient } from \"@belfed/koemment\";\r\n\r\nconst client = new KoemmentClient(\"https://your-koemment-api.example.com\");\r\n\r\n// Read comments for a post (author name/image and your own vote included if you're logged in)\r\nconst comments = await client.getComments(\"post-123\");\r\n\r\n// Paginate through a heavily-commented post (limit defaults to 100, capped at 200)\r\nconst nextPage = await client.getComments(\"post-123\", { limit: 50, offset: 50 });\r\n\r\n// Create a comment\r\nconst comment = await client.createComment(\"post-123\", \"Great post!\");\r\n\r\n// Reply to a comment\r\nconst reply = await client.createComment(\"post-123\", \"I agree!\", comment.id);\r\n\r\n// Vote on a comment\r\nawait client.vote(comment.id, 1); // upvote\r\nawait client.vote(comment.id, -1); // downvote\r\nawait client.removeVote(comment.id);\r\n\r\n// Delete your own comment\r\nawait client.deleteComment(comment.id);\r\n```\r\n\r\nA deleted comment is kept (so replies to it still have a parent) but stripped down: `isDeleted` is\r\n`true` and `content` is `null`. Render those as a `[deleted]` placeholder rather than filtering them\r\nout, the way Reddit does.\r\n\r\nEvery request is sent with `credentials: \"include\"`, so the browser's koemment session cookie is\r\nattached automatically. `createComment`, `deleteComment`, `vote`, and `removeVote` all require the\r\nvisitor to be logged in (via GitHub or Google) with the koemment instance this client points at.\r\n`getComments` works for anonymous visitors too — `myVote` is simply `null` on every comment when\r\nnobody's logged in.\r\n\r\n`createComment`, `deleteComment`, `vote`, and `removeVote` are rate-limited server-side (20 requests\r\nper minute per visitor); going over throws once the API responds with `429`.\r\n\r\n## Development\r\n\r\n- Install dependencies: `pnpm install` (from the repo root)\r\n- Run the unit tests: `pnpm test`\r\n- Build the library: `pnpm build`\r\n","readmeFilename":""}