![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
zeebe-node-nestjs
Advanced tools
for older zeebe please use @payk/nestjs-zeebe
// main.ts
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { ZeebeServer } from 'zeebe-node-nestjs';
async function bootstrap() {
const app = await NestFactory.create(AppModule);
const microservice = app.connectMicroservice({
strategy: app.get(ZeebeServer),
});
await app.startAllMicroservicesAsync();
await app.listen(3000);
}
bootstrap();
// app.module.ts
import { Module } from '@nestjs/common';
import { AppController } from './app.controller';
import { ZeebeModule, ZeebeServer } from 'zeebe-node-nestjs';
@Module({
imports: [
ZeebeModule.forRoot({ gatewayAddress: 'localhost:26500' })
],
controllers: [AppController],
providers: [ZeebeServer],
})
export class AppModule {}
// app.controller.ts
import { Controller, Get, Inject } from '@nestjs/common';
import { AppService } from './app.service';
import { ZBClient, Duration } from 'zeebe-node';
import { ZEEBE_CONNECTION_PROVIDER, ZeebeWorker } from 'zeebe-node-nestjs';
@Controller()
export class AppController {
constructor(
private readonly appService: AppService,
@Inject(ZEEBE_CONNECTION_PROVIDER)
private readonly zbClient: ZBClient,
) {}
// Use the client to create a new process instance
@Get()
getHello(): Promise<CreateWorkflowInstanceResponse> {
return this.zbClient.createProcessInstance('Process_sample', { test: 1 });
}
// Subscribe to events of type 'Activity_test'
@ZeebeWorker('Activity_test')
async test(job) {
console.log(job);
this.appService.doSomething();
job.complete();
}
// publish a message
@Post()
sendHello() {
this.zbClient.publishMessage({
name: 'message_notification',
correlationKey: '1234',
variables: { greeting: 'Hello' },
timeToLive: Duration.seconds.of(10),
});
}
}
FAQs
Zeebe-Node client wrapper for NestJS
We found that zeebe-node-nestjs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.