Catalog npm
Back to packageRELEASE DETAILS

0.4.3

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
@021.is/spine-errors
Environment
{
  "local_name": "@021.is/spine-errors",
  "alias": false,
  "peer_metadata": null
}
^0.4.3runtime
nats
Environment
{
  "local_name": "nats",
  "alias": false,
  "peer_metadata": null
}
^2.28.2runtime

Distribution files

1 collected
Distribution 1

Source distribution

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

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:e725cd7bac71b6f24a9a1c131afb645f04784d0683e899e482ec630474bef1bc

Other collected versions

0.4.028 MayView all collected versions →