Catalog npm
Back to packageRELEASE DETAILS

0.4.0

npm

@021.is/spine-jobs

NATS JetStream publisher + consumer wrapper. Async fan-out + cron triggers + work queues, all going through your NATS instance.

Published28 May 2026
Direct dependencies2
Transitive dependenciesNot calculated

README

Current package documentation

@021.is/spine-jobs

Wrapper around NATS JetStream (your NATS instance).

Three uses:

  • Async fan-out — a publisher emits event.published; independent consumers (audit, analytics, push) each handle it. No HTTP, no waiting, no fragile orchestration.
  • Cron triggers — spine.cron.daily-billing-run published by a tiny scheduler pod; the billing service consumes.
  • Work queues — long-running jobs (image processing, batch emails) get enqueued; consumers pick them up at their own pace.

Use

import { connectJobs } from "@021.is/spine-jobs";

const jobs = await connectJobs({ servers: env.NATS_URL });

// Publish
await jobs.publish("event.published", { eventId: "e_1", organizerId: "o_1" });

// Consume (one consumer per concern; durable so it survives restarts)
await jobs.consume("event.published", "audit-consumer", async (payload) => {
  await db.audit.create({ data: { action: "event.published", ...payload } });
});

Tests

JetStream-dependent — gated by a Testcontainers NATS image when added to the test suite. For now, integration tests live in the consuming repos.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 2

Native requirements
2 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
nats
Environment
{
  "local_name": "nats",
  "alias": false,
  "peer_metadata": null
}
^2.28.2runtime
@021.is/spine-errors
Environment
{
  "local_name": "@021.is/spine-errors",
  "alias": false,
  "peer_metadata": null
}
^0.4.0runtime

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "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
}

Repository

PENDING
021is/spine-ts

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 22:00 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:f3b1da67ba17d1bbedae90caaa4287f5491c4cc97871aba7aa31335304124d7d

Other collected versions

0.4.328 MayView all collected versions →