Socket
Socket
Sign inDemoInstall

nestjs-cronjob

Package Overview
Dependencies
28
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    nestjs-cronjob

NestJS cron config Module


Version published
Weekly downloads
4
decreased by-20%
Maintainers
1
Install size
371 kB
Created
Weekly downloads
 

Changelog

Source

1.0.0

  • First version

Readme

Source

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

Keywords

FAQs

Last updated on 29 Oct 2019

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc