@trapts/schedule

1.0.3 • Public • Published

schedule

Trap schedule loader.

install

npm install @trapts/schedule --save

example

  • app.ts
import { schedule } from '@trapts/schedule'
import { resolve } from 'path'

schedule(resolve(__dirname, 'demo'))
  • demo/test.ts
import { Subcription, Schedule } from '@trapts/schedule'

export class TestSchedule implements Subcription {
  public static schedule(): Schedule {
    return {
      disable: false,
      cron: '1 * * * * *',
      env: 'development',
      timeZone: 'Asia/Shanghai'
    }
  }
  async subscribe(): Promise<void> {
    console.log('Hello World')
  }
}

Readme

Keywords

none

Package Sidebar

Install

npm i @trapts/schedule

Weekly Downloads

5

Version

1.0.3

License

MIT

Unpacked Size

32.2 kB

Total Files

12

Last publish

Collaborators

  • alfieri