1.0.0 • Published 5 years ago

nestjs-cronjob v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

NestJS cron Module

NestJS cron package allows you easily setup cron for your controllers or services.

npm i nestjs-cron

Then register module in your root app.module

import { CronModule } from 'nestjs-cron';

@Module({
	imports: [
		// ...
		CronModule.forRoot(),
	],
})
export class AppModule {}

To use cron, decorate your class with @Scheduled() and method with @Cron('* * * * * *')

To use ConfigService in any service or controller just inject it with @ConfigInjection decorator in the constructor:

import { ConfigService, ConfigInjection } from 'nestjs-dotenv';

constructor(
	@ConfigInjection() private readonly configService: ConfigService
) {}

To get a value from .env file just call get() method:

this.configService.get('JIRA_TOKEN');
  • JIRA_TOKEN - name of your key in .env file:
JIRA_TOKEN=0000000000000
1.0.0

5 years ago

0.0.30

5 years ago

0.0.29

5 years ago

0.0.28

5 years ago

0.0.27

5 years ago

0.0.26

5 years ago

0.0.25

5 years ago

0.0.24

5 years ago

0.0.23

5 years ago

0.0.22

5 years ago

0.0.21

5 years ago

0.0.20

5 years ago

0.0.19

5 years ago

0.0.18

5 years ago

0.0.17

5 years ago

0.0.16

5 years ago

0.0.15

5 years ago

0.0.14

5 years ago

0.0.13

5 years ago

0.0.12

5 years ago

0.0.11

5 years ago

0.0.10

5 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago