
Security News
Critical Security Vulnerability in React Server Components
React disclosed a CVSS 10.0 RCE in React Server Components and is advising users to upgrade affected packages and frameworks to patched versions now.
nest-agenda-jobs
Advanced tools
This is a Agenda task wrapper module for Nest.
$ npm i --save nest-agenda-jobs
import { Injectable } from '@nestjs/common';
import { Task } from '../lib';
@Injectable()
export class AppTasks {
@Task({ name: 'justATest' })
justATest(job: Agenda.Job, done) {
const result: number = (job.attrs.data || []).reduce((a, b) => a + b);
setTimeout(() => {
done(null, result);
}, 900);
}
}
import { Controller, Get } from '@nestjs/common';
import { AgendaService } from '../lib';
import { AppTasks } from './app.tasks';
@Controller('app')
export class AppController {
constructor(
private readonly agendaService: AgendaService,
private readonly tasks: AppTasks,
) {}
@Get()
public async runTask() {
const data = [1, 2, 3];
await this.agendaService.createJob(this.tasks.justATest, {
type: 'now',
autoRemove: false,
}, data);
return true;
}
}
import { Module, OnModuleInit } from '@nestjs/common';
import { ModuleRef } from '@nestjs/core';
import { AgendaModule, AgendaTaskRegisterService, AgendaService } from '../lib';
import { AppTasks } from './app.tasks';
import { AppController } from './app.controller';
@Module({
imports: [AgendaModule],
controllers: [AppController],
providers: [AppTasks],
})
export class AppModule implements OnModuleInit {
constructor(
private readonly moduleRef: ModuleRef,
private readonly taskRegister: AgendaTaskRegisterService,
) {}
async onModuleInit() {
this.taskRegister.setModuleRef(this.moduleRef);
await this.taskRegister.register(AppTasks, {
collection: 'test',
options: {
db: {
address: 'mongodb://127.0.0.1/agenda',
options: {
useNewUrlParser: true,
},
},
},
});
}
}
FAQs
Bull tasks wrapper for NestJS framework
We found that nest-agenda-jobs 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
React disclosed a CVSS 10.0 RCE in React Server Components and is advising users to upgrade affected packages and frameworks to patched versions now.

Research
/Security News
We spotted a wave of auto-generated “elf-*” npm packages published every two minutes from new accounts, with simple malware variants and early takedowns underway.

Security News
TypeScript 6.0 will be the last JavaScript-based major release, as the project shifts to the TypeScript 7 native toolchain with major build speedups.