Registry / devops / queue-ast-hop

queue-ast-hop

JSON →
library0.6.0jsnpmunverified

Queue-ast-hop is a static analysis tool (v0.6.0) that builds a dependency graph for BullMQ and glide-mq job queues. It traces producer-to-worker hops through virtual queueFile#job nodes, enabling impact analysis for changed files across async job boundaries. The package provides CLI commands (edges, related, check) and integrates with monorepo tooling. It is released as a dev dependency, with no runtime deps beyond Node. Differentiator: unlike runtime queue monitoring, it parses static call sites (addJob, Worker, etc.) to produce Acyclic Directed Graph (ADG) edges without requiring a live Redis or queue instance.

npm install queue-ast-hop
INSTALL
IMPORT
SIG · QUEUE-AST-HOP
Q
queue-ast-hop
devopsjavascriptv0.6.0
harness data pending
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.

queueAstHop
import { queueAstHop } from 'queue-ast-hop'
import queueAstHop from 'queue-ast-hop'
Named export only; default export does not exist.
analyzeQueueFile
import { analyzeQueueFile } from 'queue-ast-hop'
const { analyzeQueueFile } = require('queue-ast-hop')
Package is ESM-only since v0.5.0; require() will fail with ERR_REQUIRE_ESM.
edges
import { edges } from 'queue-ast-hop/cli'
import edges from 'queue-ast-hop/cli'
CLI functions are exported from a separate subpath. Named import only.

Shows programmatic usage: analyzing queue dependencies, writing graph to JSON, and error handling.

import { edges } from 'queue-ast-hop/cli'; import { writeFileSync } from 'fs'; async function main() { try { const result = await edges({ cwd: process.cwd(), include: ['src/**/*.ts'], exclude: ['**/*.test.ts', '**/node_modules/**'] }); writeFileSync('queue-graph.json', JSON.stringify(result, null, 2)); console.log(`Found ${result.nodes.length} nodes and ${result.edges.length} edges.`); } catch (err) { console.error('Analysis failed:', err.message); process.exit(1); } } main();
Debug
Known issues
breakingRequire() fails with ERR_REQUIRE_ESM in Node.js < 16 or when using require() instead of import.
fix
Use ES module import syntax; set type: module in package.json or use .mjs extension.
affects: >=0.5.0
deprecatedThe 'analyzeQueueFile' symbol is deprecated in v0.6.0 in favor of 'queueAstHop'.
fix
Replace 'analyzeQueueFile' calls with 'queueAstHop'.
affects: >=0.6.0
gotchaThe CLI 'edges' subcommand requires 'glide-mq' or 'bullmq' to be installed as peer dependencies, but they are not listed in package.json peerDependencies.
fix
Manually install either 'bullmq' or 'glide-mq' before running npx queue-ast-hop edges.
affects: >=0.1.0
gotchaQueue file must export the queue instance for analysis; default export 'queue' is required, named exports are not detected.
fix
Ensure you have a default export of your queue instance (e.g., export default new Queue('myqueue')).
affects: >=0.1.0
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module
Package is ESM-only since v0.5.0; using require() instead of import.
fix
Use import { queueAstHop } from 'queue-ast-hop' or upgrade to Node >= 16 with type: module.
Cannot find module 'bullmq' or 'glide-mq'
Missing peer dependency; queue-ast-hop requires either bullmq or glide-mq to be installed.
fix
npm install bullmq --save-dev or npm install glide-mq --save-dev
No queue found in file path/to/job.ts
The file does not have a default export of a BullMQ or glide-mq Queue instance.
fix
Ensure the file exports default: export default new Queue('queueName').
Upgrade
Version history
0.6.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
queue-ast-hop — npm install queue-ast-hop · libregistry