{"_id":"@021.is/spine-jobs","_rev":"2-e27bb3c63bb6905dbf2d54be4be0d185","name":"@021.is/spine-jobs","dist-tags":{"latest":"0.4.3"},"versions":{"0.4.0":{"name":"@021.is/spine-jobs","version":"0.4.0","license":"MIT","_id":"@021.is/spine-jobs@0.4.0","maintainers":[{"name":"edvone","email":"edvard@edvone.dev"}],"homepage":"https://github.com/021is/spine-ts#readme","bugs":{"url":"https://github.com/021is/spine-ts/issues"},"dist":{"shasum":"1ae15cbff7037ef751891326b158d50b4cb62548","tarball":"https://registry.npmjs.org/@021.is/spine-jobs/-/spine-jobs-0.4.0.tgz","fileCount":4,"integrity":"sha512-FkO2CwntkgOUzVu3mNF41sJ0udEc+x7TlrUTJ2Bd7SIkJ6r73OlGvHLLxqeelOqRptBUV6hsA0/jWU33aYCEWg==","signatures":[{"sig":"MEUCIQDMr15LIu8I21azFT9AYdoz9RrPm+QXtQfiLreJbOWwRAIgENefu3CBg8itFBZlAI/6z5xaYq2s/jUZfVmwciSFL/A=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":4995},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"e4434c6f59db8f586e0f05ffdb3b88a96e68e67b","scripts":{"build":"tsup src/index.ts --format esm --dts --clean","typecheck":"tsc --noEmit"},"_npmUser":{"name":"edvone","email":"edvard@edvone.dev"},"repository":{"url":"git+https://github.com/021is/spine-ts.git","type":"git","directory":"packages/jobs"},"_npmVersion":"10.9.4","description":"NATS JetStream publisher + consumer wrapper. Async fan-out + cron triggers + work queues, all going through your NATS instance.","directories":{},"_nodeVersion":"22.22.0","dependencies":{"nats":"^2.28.2","@021.is/spine-errors":"^0.4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/spine-jobs_0.4.0_1779981955278_0.7043227026204655","host":"s3://npm-registry-packages-npm-production"}},"0.4.3":{"name":"@021.is/spine-jobs","version":"0.4.3","license":"MIT","description":"NATS JetStream publisher + consumer wrapper. Async fan-out + cron triggers + work queues, all going through your NATS instance.","type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"build":"tsup src/index.ts --format esm --dts --clean","typecheck":"tsc --noEmit"},"dependencies":{"@021.is/spine-errors":"^0.4.3","nats":"^2.28.2"},"repository":{"type":"git","url":"git+https://github.com/021is/spine-ts.git","directory":"packages/jobs"},"publishConfig":{"access":"public"},"_id":"@021.is/spine-jobs@0.4.3","gitHead":"b9f9333776fa55686cc2feb05f851aa6000b0e05","bugs":{"url":"https://github.com/021is/spine-ts/issues"},"homepage":"https://github.com/021is/spine-ts#readme","_nodeVersion":"22.22.0","_npmVersion":"10.9.4","dist":{"integrity":"sha512-IBToAP4zRthYS9RvYgch+EHFEnysVuEh2zF+9LJXbihRoBQ+oKePu2yjhjKjgBlyG5F1/P/y2lqeu5hkvhPejA==","shasum":"b054591c92658d487b2ac69a2a2cbc7607159ab4","tarball":"https://registry.npmjs.org/@021.is/spine-jobs/-/spine-jobs-0.4.3.tgz","fileCount":5,"unpackedSize":6401,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDppuyPYqDs57OmCflWl5B5DgGXQBECgsALmigAD5BLagIgE8AHGVWyXHpvkUPAX0Gq//ahdpg6VyT92JcRvJNjJro="}]},"_npmUser":{"name":"edvone","email":"edvard@edvone.dev"},"directories":{},"maintainers":[{"name":"edvone","email":"edvard@edvone.dev"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/spine-jobs_0.4.3_1779995244088_0.8050284546054343"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-28T15:25:55.085Z","modified":"2026-05-28T19:07:24.412Z","0.4.0":"2026-05-28T15:25:55.417Z","0.4.3":"2026-05-28T19:07:24.238Z"},"bugs":{"url":"https://github.com/021is/spine-ts/issues"},"license":"MIT","homepage":"https://github.com/021is/spine-ts#readme","repository":{"type":"git","url":"git+https://github.com/021is/spine-ts.git","directory":"packages/jobs"},"description":"NATS JetStream publisher + consumer wrapper. Async fan-out + cron triggers + work queues, all going through your NATS instance.","maintainers":[{"name":"edvone","email":"edvard@edvone.dev"}],"readme":"# @021.is/spine-jobs\n\nWrapper around NATS JetStream (your NATS instance).\n\nThree uses:\n\n- **Async fan-out** — a publisher emits `event.published`; independent consumers (audit, analytics, push) each handle it. No HTTP, no waiting, no fragile orchestration.\n- **Cron triggers** — `spine.cron.daily-billing-run` published by a tiny scheduler pod; the billing service consumes.\n- **Work queues** — long-running jobs (image processing, batch emails) get enqueued; consumers pick them up at their own pace.\n\n## Use\n\n```ts\nimport { connectJobs } from \"@021.is/spine-jobs\";\n\nconst jobs = await connectJobs({ servers: env.NATS_URL });\n\n// Publish\nawait jobs.publish(\"event.published\", { eventId: \"e_1\", organizerId: \"o_1\" });\n\n// Consume (one consumer per concern; durable so it survives restarts)\nawait jobs.consume(\"event.published\", \"audit-consumer\", async (payload) => {\n  await db.audit.create({ data: { action: \"event.published\", ...payload } });\n});\n```\n\n## Tests\n\nJetStream-dependent — gated by a Testcontainers NATS image when added to the test suite. For now, integration tests live in the consuming repos.\n","readmeFilename":"README.md"}