@cheetah.js/schedule
TypeScript icon, indicating that this package has built-in type declarations

0.1.18 • Public • Published

Schedule plugin for Cheetah.js

This plugin provides a simple way to schedule tasks in Cheetah.js.

Installation

For install, run the command below:

bun install @cheetah.js/schedule

Usage

Only add the plugin to the Cheetah.js instance:

import {Cheetah} from '@cheetah.js/core';

new Cheetah().use(CheetahSchedule).listen();

Schedule tasks

Example:

import { Cheetah, Service, Get, Schedule } from '@cheetah.js/core';

@Service()
export class HomeController {
  @Schedule('* * * * * *')
  index() {
    return '';
  }
  
  @Interval(1000)
  index() {
    return '';
  }
  
  @Timeout(1000)
  index() {
    return '';
  } 
}

Readme

Keywords

none

Package Sidebar

Install

npm i @cheetah.js/schedule

Weekly Downloads

1

Version

0.1.18

License

MIT

Unpacked Size

40.8 kB

Total Files

41

Last publish

Collaborators

  • mlusca