A TypeScript implementation of a Celery client for Node.js
npm install celery-pluscelery-plus was created to provide:
- 🔄 Active maintenance with regular updates
- 📘 TypeScript support with full type definitions
- 🚀 Latest protocol versions (v1 and v2)
- 🔧 Modern Node.js compatibility
- 🛡️ Improved reliability and bug fixes
- 🌐 Cross-language task distribution with Python Celery workers
Applications ("Producers") register code as tasks. Workers ("Consumers") execute these tasks and can store results in a backend. The broker receives tasks as messages and routes them to consumers.
Celery is a popular open-source task queue. A Celery system can have multiple workers and brokers, supporting high availability and horizontal scaling. Key features: simple, highly available, fast, and flexible.
Celery is written in Python, but the protocol can be implemented in any language. There's gocelery for Go, and now celery-plus for Node.js.
celery-plus supports Celery Message Protocol Version 1 and Version 2.
``javascript`
client.conf.TASK_PROTOCOL = 2; // 1 or 2. Default is 2.
For more details, see the Celery protocol reference.
`bash`
npm install celery-plus
- ✅ Full Celery Protocol Support - Supports v1 and v2
- 📘 TypeScript - Written in TypeScript with full type definitions
- ⚡ Async/Await Support - Modern async patterns
- 🔄 Multiple Brokers - Support for AMQP (RabbitMQ) and Redis
- 💾 Multiple Backends - Store results in AMQP or Redis
- 🧩 Interoperable - Works seamlessly with Python Celery workers
- ⚙️ Configurable - Flexible queue and routing configuration
javascript
const celery = require('celery-plus');const client = celery.createClient(
"amqp://",
"amqp://"
);
const task = client.createTask("tasks.add");
const result = task.applyAsync([1, 2]);
result.get().then(data => {
console.log(data);
client.disconnect();
});
`
#### python
`python
from celery import Celeryapp = Celery('tasks',
broker='amqp://',
backend='amqp://'
)
@app.task
def add(x, y):
return x + y
if __name__ == '__main__':
result = add.apply_async((1, 2), serializer='json')
print(result.get())
`
$3
#### celery-plus
`javascript
const celery = require('celery-plus');const worker = celery.createWorker(
"amqp://",
"amqp://"
);
worker.register("tasks.add", (a, b) => a + b);
worker.start();
`
#### python
`python
from celery import Celeryapp = Celery('tasks',
broker='amqp://',
backend='amqp://'
)
@app.task
def add(x, y):
return x + y
`Running Examples
$3
- Node.js and npm installed
- Docker and docker-compose installed$3
`bash
Generate dist/ directory (tutorial files depend on it)
$ npm run distStart RabbitMQ container
$ docker-compose -f examples/docker-compose.yml up -d rabbitRun celery-plus client with RabbitMQ
$ node examples/tutorial/client.jsRun celery-plus worker with RabbitMQ
$ node examples/tutorial/worker.jsStop and remove containers
$ docker-compose -f examples/docker-compose.yml down
``Contributions are welcome! Please read contributing.md before submitting pull requests.
MIT © 2025 archer947
Based on celery-node by SunMyeong Lee (MIT License)