Registry / devops / nitro-queue

nitro-queue

JSON →
library0.0.7jsnpmunverified

A module for Nitro v3 that provides Cloudflare Queue support. It automatically configures queue routes by scanning a queues directory, generates TypeScript types for queue payloads, and handles routing from cloudflare:queue. Currently at version 0.0.7, it requires Nitro ^3.0.1-alpha.2 and has not been thoroughly tested. It differentiates by integrating directly with Nitro's module system and automating type generation with wrangler.

devops
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Named export; default import is not available.

import { defineQueue } from 'nitro-queue'

Default export for module configuration in nitro.config.ts.

import queue from 'nitro-queue'

Shows module setup, defining a queue handler, and sending a message from a route.

// nitro.config.ts import queue from 'nitro-queue' import { defineNitroConfig } from 'nitro/config' export default defineNitroConfig({ modules: [queue()], }) // queues/user/remove.ts import { defineQueue } from 'nitro-queue' export default defineQueue<{ userId: string }>({ run(payload) { console.log(payload.userId) } }) // routes/publish.ts import { defineHandler } from 'nitro/runtime' export default defineHandler(async (e) => { const userId = '123' e.runtime.cloudflare.env.MY_QUEUE.send({ type: 'user:remove', payload: { userId } }) })
Debug
Known footguns
gotchaModule not thoroughly tested; may have bugs in production
breakingRequires Nitro v3 alpha.2 or later; incompatible with older versions
gotchaType generation requires wrangler to be run first
deprecatedThe module may become deprecated if Nitro changes queue handling
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
10 hits · last 30 days
gptbot
3
bingbot
1
mj12bot
1
ahrefsbot
1
Resources