Registry / messaging / node-laravel-queue

node-laravel-queue

JSON →
library0.1.7jsnpmunverified

Node.js library to sync queues between NodeJS and Laravel using Redis as the driver. Current version is 0.1.7, with no active release cadence (last update unknown). This library is a fork of Noderavel, allowing Node.js to process jobs dispatched from Laravel and vice versa. It provides Job and Queue classes that connect to a Redis instance and handle serialization/deserialization of job payloads compatible with Laravel's queue system. Note: This is a very early-stage package with limited documentation and no tests indicated. Not recommended for production without thorough review.

npm install node-laravel-queue
INSTALL
IMPORT
SIG · NODE-LARAVEL-QUEUE
N
node-laravel-queue
messagingjavascriptv0.1.7
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.

Job
import { Job } from 'node-laravel-queue'
const Job = require('node-laravel-queue').Job
Package uses CommonJS; ESM import is not supported natively. Use require() or a bundler.
Queue
import { Queue } from 'node-laravel-queue'
const Queue = require('node-laravel-queue').Queue
Same as Job; use destructured require or named import.
default
const nodelaravel = require('node-laravel-queue')
import nodelaravel from 'node-laravel-queue'
Package has no default export; use namespace require.

Demonstrates listening for jobs from Laravel and pushing a job to Laravel using Redis queue.

const { Queue, Job } = require('node-laravel-queue'); const redis = require('redis'); const redisClient = redis.createClient(); // Listen for jobs from Laravel const consumer = new Queue({ client: redisClient, queue: 'nodeJS', driver: 'redis', scope: { 'App\\Jobs\\TestJob': Job } }); consumer.on('job', ({ name, data }) => { console.log('Received job:', name, data); }); consumer.listen(); // Send a job to Laravel const producer = new Queue({ client: redisClient, appname: 'MyApp', driver: 'redis', scope: { 'App\\Jobs\\TestJob': Job } }); const job = new Job({ a: 'hello', b: 'world' }); producer.redisPush('App\\Jobs\\TestJob', job);
Debug
Known issues
gotchaThe scope property expects class names with double backslashes in string (e.g., 'App\\Jobs\\TestJob'). Missing escaping leads to undefined behavior.
fix
Use double backslashes in scope keys: 'App\\Jobs\\TestJob'.
affects: >=0.0.0
breakingPackage version 0.1.7 is very early; API may change without notice.
fix
Pin dependency to exact version and test thoroughly.
affects: >=0.0.0
deprecatedNo active maintenance; last commit unknown. Consider using alternatives like noderavel or custom solution.
fix
Evaluate fork or build own adapter.
affects: >=0.0.0
gotchaThe redis client must be passed as is; the library does not manage connection lifecycle. Forgetting to call redisClient.connect() (redis v4) will cause errors.
fix
Ensure redis client is connected before using Queue (e.g., client.connect().then(...) for redis v4).
affects: >=0.0.0
Errors
Common errors & fixes
TypeError: redisClient.on is not a function
Using redis@4 which uses Promise-based API; old on method removed.
fix
Use redis@3 or wrap client: const client = redis.createClient(); client.on('error', (err) => {}); // works with v3
Error: Job class not found in scope: App\Jobs\TestJob
The scope key does not match the serialized job class name exactly (case sensitivity, backslash escaping).
fix
Ensure scope key matches the Laravel job class exactly, with double backslashes: 'App\\Jobs\\TestJob'
Redis connection refused (ECONNREFUSED)
Redis server not running or wrong host/port.
fix
Start Redis server: redis-server, or check connection config.
Upgrade
Version history
0.1.7latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
5 hits · last 30 days
node
4
OpenAI (training)
1
Resources