{"_id":"@donothing/jobq","_rev":"5-4dc1f6f131bfe2f3781769176f0681e5","name":"@donothing/jobq","dist-tags":{"latest":"1.2.0"},"versions":{"1.0.0":{"name":"@donothing/jobq","type":"module","version":"1.0.0","description":"a job queue backed by sqlite","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"}}},"scripts":{"build":"tsc -p tsconfig.json","prepare":"tsc -p tsconfig.json","test":"echo \"Error: no test specified\" && exit 1"},"keywords":[],"private":false,"publishConfig":{"access":"public"},"author":{"name":"gerard@gerardpaapu.com"},"license":"ISC","dependencies":{"sqlite3":"^5.1.7"},"devDependencies":{"@types/node":"^20.12.8","esbuild":"^0.20.2","tsx":"^4.9.1","typescript":"^5.4.5"},"prettier":{"semi":false,"singleQuote":true},"_id":"@donothing/jobq@1.0.0","gitHead":"bf0eee1c010a12c43b81783fd92eae51549dd1ea","_nodeVersion":"20.10.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-1d5Tnsk4hjoiI3UbXRfBxH/d6iltaySaLEWL9L9mvKVVGCg5eL9nVOe/dCixlcNwF+DyusvVstttbOu49O+tZw==","shasum":"5762e7a9790837bcf5925447f4e0938ad96a5747","tarball":"https://registry.npmjs.org/@donothing/jobq/-/jobq-1.0.0.tgz","fileCount":6,"unpackedSize":17226,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDWofxxB5IBEw+IQtMD1cho8P3XU2lHMWwtNAS5fp4HPgIgG2xJlf9prjM2FrYy2Ir84vrmWvo5UgXkkX8XNRlU9Uc="}]},"_npmUser":{"name":"sharkpal","email":"gerard@gerardpaapu.com"},"directories":{},"maintainers":[{"name":"sharkpal","email":"gerard@gerardpaapu.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jobq_1.0.0_1714944481586_0.38400998132294006"},"_hasShrinkwrap":false},"1.0.1":{"name":"@donothing/jobq","type":"module","version":"1.0.1","description":"a job queue backed by sqlite","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"}}},"scripts":{"build":"tsc -p tsconfig.json","prepare":"tsc -p tsconfig.json","test":"echo \"Error: no test specified\" && exit 1"},"keywords":[],"private":false,"publishConfig":{"access":"public"},"author":{"name":"gerard@gerardpaapu.com"},"license":"ISC","dependencies":{"sqlite3":"^5.1.7"},"devDependencies":{"@types/node":"^20.12.8","esbuild":"^0.20.2","tsx":"^4.9.1","typescript":"^5.4.5"},"prettier":{"semi":false,"singleQuote":true},"_id":"@donothing/jobq@1.0.1","gitHead":"981c66989d225c0a1b765691fa80246bbdfbe4dd","_nodeVersion":"20.10.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-DlaZ+BCawMzbHlfXHfyiOEtStH2uK7WUSJAo/+2Ka485uPND1TjZw3oy/1M2yEyncaKzr6u9+mo8jVyR1UcnrA==","shasum":"797cceee21af81194e17e817385ad6bbf151eaa3","tarball":"https://registry.npmjs.org/@donothing/jobq/-/jobq-1.0.1.tgz","fileCount":6,"unpackedSize":17234,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDH9IakkQAZsb1W/ZAC6TFuuv5Py99blfJxeZa16l8RowIhAMd6KK3q//Qsjk24gMobmT8jq0cfosb5dyl6Me9P3ojm"}]},"_npmUser":{"name":"sharkpal","email":"gerard@gerardpaapu.com"},"directories":{},"maintainers":[{"name":"sharkpal","email":"gerard@gerardpaapu.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jobq_1.0.1_1714944509062_0.1897191575117374"},"_hasShrinkwrap":false},"1.0.2":{"name":"@donothing/jobq","type":"module","version":"1.0.2","repository":{"type":"git","url":"git+ssh://git@github.com/gerardpaapu/jobq.git"},"description":"a job queue backed by sqlite","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"}}},"scripts":{"build":"tsc -p tsconfig.json","prepare":"tsc -p tsconfig.json","test":"echo \"Error: no test specified\" && exit 1"},"keywords":[],"private":false,"publishConfig":{"access":"public"},"author":{"name":"gerard@gerardpaapu.com"},"license":"ISC","dependencies":{"sqlite3":"^5.1.7"},"devDependencies":{"@types/node":"^20.12.8","esbuild":"^0.20.2","tsx":"^4.9.1","typescript":"^5.4.5"},"prettier":{"semi":false,"singleQuote":true},"_id":"@donothing/jobq@1.0.2","gitHead":"2f2df2c44a4569cf494f777fb7bf6e1787081ce9","bugs":{"url":"https://github.com/gerardpaapu/jobq/issues"},"homepage":"https://github.com/gerardpaapu/jobq#readme","_nodeVersion":"20.10.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-kR5KbFCFqbO5iHgT/NylzZF3VvoMpwZcYk3ik3YwM4JmmQj+pnF71W5XKxQdcKMHc/R6I8Ta7NRR9qJzLkAnmg==","shasum":"bb4d679ae3934f8769e5706480885a33b7fda729","tarball":"https://registry.npmjs.org/@donothing/jobq/-/jobq-1.0.2.tgz","fileCount":6,"unpackedSize":17325,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDtY6jfk/0sNNP+QLVqn6TN0uGsvT0mMuwoWkFn4KlQiwIhAKHU168eM02/ObietMg3YTJpPXita1HOVY5edMOsIO4v"}]},"_npmUser":{"name":"sharkpal","email":"gerard@gerardpaapu.com"},"directories":{},"maintainers":[{"name":"sharkpal","email":"gerard@gerardpaapu.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jobq_1.0.2_1714944622822_0.02729807651257632"},"_hasShrinkwrap":false},"1.0.3":{"name":"@donothing/jobq","type":"module","version":"1.0.3","repository":{"type":"git","url":"git+ssh://git@github.com/gerardpaapu/jobq.git"},"description":"a job queue backed by sqlite","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"}}},"scripts":{"build":"tsc -p tsconfig.json","prepare":"tsc -p tsconfig.json","test":"echo \"Error: no test specified\" && exit 1"},"keywords":[],"private":false,"publishConfig":{"access":"public"},"author":{"name":"gerard@gerardpaapu.com"},"license":"ISC","dependencies":{"sqlite3":"^5.1.7"},"devDependencies":{"@types/node":"^20.12.8","esbuild":"^0.20.2","tsx":"^4.9.1","typescript":"^5.4.5"},"prettier":{"semi":false,"singleQuote":true},"_id":"@donothing/jobq@1.0.3","gitHead":"a2a18b1e3e9d82eb427fa85f4cf319cd0bf78102","bugs":{"url":"https://github.com/gerardpaapu/jobq/issues"},"homepage":"https://github.com/gerardpaapu/jobq#readme","_nodeVersion":"20.10.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-Kj18T5u/BFAnsvdKd/4ptU5mRfb5G/JHYMXAyMBGi647YC56c07MBKQnbS6xTFq7fllv+BNZDSnsmM2H7XMLZQ==","shasum":"2f572b3d97eedc4515f34f2bef1d114e732ee85a","tarball":"https://registry.npmjs.org/@donothing/jobq/-/jobq-1.0.3.tgz","fileCount":6,"unpackedSize":17335,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDo9Dlegrw9ows/P13+hyaB07PcKPcoFYNL5T8R4S12FAiEA7dYS/kYh8pXK8+5lKGkCzVadisTaMqxipKhtzE1v3N8="}]},"_npmUser":{"name":"sharkpal","email":"gerard@gerardpaapu.com"},"directories":{},"maintainers":[{"name":"sharkpal","email":"gerard@gerardpaapu.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jobq_1.0.3_1714944662938_0.9932234168490985"},"_hasShrinkwrap":false},"1.1.0":{"name":"@donothing/jobq","type":"module","version":"1.1.0","repository":{"type":"git","url":"git+ssh://git@github.com/gerardpaapu/jobq.git"},"description":"a job queue backed by sqlite","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"}}},"scripts":{"build":"tsc -p tsconfig.json","prepare":"tsc -p tsconfig.json","test":"echo \"Error: no test specified\" && exit 1"},"keywords":[],"private":false,"publishConfig":{"access":"public"},"author":{"name":"gerard@gerardpaapu.com"},"license":"ISC","dependencies":{"sqlite3":"^5.1.7"},"devDependencies":{"@types/node":"^20.12.8","esbuild":"^0.20.2","tsx":"^4.9.1","typescript":"^5.4.5"},"prettier":{"semi":false,"singleQuote":true},"_id":"@donothing/jobq@1.1.0","gitHead":"f4ab992e6c248a222e91314813777d6e54396641","bugs":{"url":"https://github.com/gerardpaapu/jobq/issues"},"homepage":"https://github.com/gerardpaapu/jobq#readme","_nodeVersion":"20.10.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-u8GOpSbYF94zs2UtyDpfRTE+WViyHtIEYqyFAsYtZeWpqGHA6swRVBsmputesPWrMK7vPCfLNaTvVMIAJVbY5g==","shasum":"55f5b2952f6a074eb57bc98b27cd026cc90a3078","tarball":"https://registry.npmjs.org/@donothing/jobq/-/jobq-1.1.0.tgz","fileCount":6,"unpackedSize":18353,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDY1AmbrQjEspOfWvZ4eWv41K0e9VOrCaFGEsX9PTdrJAIhANBLHwGiekRQKYsuXh4ZNroc2QGfv6BIsLpPY7Ey8VH4"}]},"_npmUser":{"name":"sharkpal","email":"gerard@gerardpaapu.com"},"directories":{},"maintainers":[{"name":"sharkpal","email":"gerard@gerardpaapu.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jobq_1.1.0_1714945955936_0.23682824934531865"},"_hasShrinkwrap":false},"1.2.0":{"name":"@donothing/jobq","type":"module","version":"1.2.0","repository":{"type":"git","url":"git+ssh://git@github.com/gerardpaapu/jobq.git"},"description":"a job queue backed by sqlite","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"}}},"scripts":{"build":"tsc -p tsconfig.json","prepare":"tsc -p tsconfig.json","test":"echo \"Error: no test specified\" && exit 1"},"keywords":[],"private":false,"publishConfig":{"access":"public"},"author":{"name":"gerard@gerardpaapu.com"},"license":"ISC","dependencies":{"sqlite3":"^5.1.7"},"devDependencies":{"@types/node":"^20.12.8","esbuild":"^0.20.2","tsx":"^4.9.1","typescript":"^5.4.5"},"prettier":{"semi":false,"singleQuote":true},"_id":"@donothing/jobq@1.2.0","gitHead":"dc046f1a50ff1a9b178cbb9a9c593d86503db8ba","bugs":{"url":"https://github.com/gerardpaapu/jobq/issues"},"homepage":"https://github.com/gerardpaapu/jobq#readme","_nodeVersion":"20.12.2","_npmVersion":"10.5.0","dist":{"integrity":"sha512-FX+Yoq0Jh/9HjdAP3oZtjSSoaMUSZfAiQ/yTzIEEuGq4tsYTCuZSp7vEm44nZs+zDZkAvBKI0Qy+i8FS7lfo0g==","shasum":"52dc335fe835ef90609a325b8640b41efdae3a64","tarball":"https://registry.npmjs.org/@donothing/jobq/-/jobq-1.2.0.tgz","fileCount":6,"unpackedSize":19435,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD5h62z497MhEEB5phIKJwIWExvvpsu8/c/7QYC/YcingIhAKqwaWGCoZtNsIZ/lSIm3RyPnYPxiEJ5DwfTrO7wBuu/"}]},"_npmUser":{"name":"sharkpal","email":"gerard@gerardpaapu.com"},"directories":{},"maintainers":[{"name":"sharkpal","email":"gerard@gerardpaapu.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jobq_1.2.0_1714970168900_0.6476263159143807"},"_hasShrinkwrap":false}},"time":{"created":"2024-05-05T21:28:01.378Z","1.0.0":"2024-05-05T21:28:01.734Z","modified":"2024-05-06T04:36:09.273Z","1.0.1":"2024-05-05T21:28:29.210Z","1.0.2":"2024-05-05T21:30:22.967Z","1.0.3":"2024-05-05T21:31:03.146Z","1.1.0":"2024-05-05T21:52:36.076Z","1.2.0":"2024-05-06T04:36:09.085Z"},"maintainers":[{"name":"sharkpal","email":"gerard@gerardpaapu.com"}],"description":"a job queue backed by sqlite","keywords":[],"author":{"name":"gerard@gerardpaapu.com"},"license":"ISC","readme":"# @donothing/jobq\n\nA job queue backed by sqlite.\n\nStrictly speaking this doesn't make any sense, since you're likely running you app server on the same machine that has the sqlite database ... so your workers are on that same machine, and you're limited to the number of cores you have on that machine.\n\nSo you should be backed by a service like redis that can be accessed by other machines so you can scale your workers out.\n\nStill, I have some students who need to get out of the habit of putting long-running processes into their request-handlers, and I don't want to spin up a bunch of new infra for them.\n\nSo think of this as a Fisher Price: My First Job Queue. Maybe this was all a silly idea and I should just spin up a RabbitMQ instance or something...\n\n... anyway, connect from your app server like this:\n\n```ts\nimport { createClient, JobParamsBase } from '@donothing/jobq'\n\ninterface JobDescription extends JobParamsBase {\n  type: 'download',\n  url: string,\n  storage: string \n}\n\nconst client = await createClient<JobDescription>(process.env.QUEUE_DB_PATH)\n\nclient.enqueueJob({\n  type: 'download',\n  url: 'http://roms.com/pokemon.zip',\n  storage: 'C:\\\\roms',\n  maximum_attempts: 10,\n  time_limit_seconds: 60,\n})\n```\n... and then in your worker process:\n```ts\nimport { createClient } from '@donothing/jobq'\n\ninterface JobDescription extends JobParamsBase {\n  type: 'download',\n  url: string,\n  storage: string \n}\n\nconst client = await createClient<JobDescription>(process.env.QUEUE_DB_PATH)\nconst MAX_WORKERS = 4\n\nclient.startWorkers(async ({ url, storage }) => {\n  const res = await fetch(url)\n  const data = await res.blob()\n  await fs.writeFile(storage, data)\n}, MAX_WORKERS)\n```\n","readmeFilename":"README.md","homepage":"https://github.com/gerardpaapu/jobq#readme","repository":{"type":"git","url":"git+ssh://git@github.com/gerardpaapu/jobq.git"},"bugs":{"url":"https://github.com/gerardpaapu/jobq/issues"}}