# @augejs/schedule

> https://augejs.github.io/docs.augejs.com/

Latest version **1.6.4** (published 2022-02-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install @augejs/schedule
pnpm add @augejs/schedule
yarn add @augejs/schedule
bun add @augejs/schedule
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.6.4 |
| Published | 2022-02-08 |
| First published | 2020-09-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Alex.Zhang |
| Maintainers | alex-zhang |

## Links

- npm: https://www.npmjs.com/package/@augejs/schedule
- Repository: https://github.com/augejs/standard-modules
- Homepage: https://augejs.github.io/docs/Techniques-Schedule
- Issues: https://github.com/augejs/standard-modules/issues
- npm.io page: https://npm.io/package/@augejs/schedule

## Dependencies (3)

- [cron](https://npm.io/package/cron.md) ^1.8.2
- [tslib](https://npm.io/package/tslib.md) ^2.3.0
- [@types/cron](https://npm.io/package/@types/cron.md) ^1.7.2

## Recent versions

- 1.6.4 (latest) — 2022-02-08
- 0.0.2-alpha.0 (canary) — 2020-09-12
- 1.6.3 — 2022-02-01
- 1.6.2 — 2021-09-11
- 1.6.1 — 2021-08-03
- 1.6.0 — 2021-08-03
- 1.5.1 — 2021-08-03
- 1.5.0 — 2021-08-03
- 1.4.2 — 2021-08-02
- 1.4.1 — 2021-08-02
- 1.4.0 — 2021-07-25
- 1.3.10 — 2021-06-26
- 1.3.9 — 2021-06-06
- 1.3.8 — 2021-06-06
- 1.3.7 — 2021-05-30
- … 30 more at https://npm.io/package/@augejs/schedule/versions

## README

# schedule

https://augejs.github.io/docs.augejs.com/


## Install

```bash
npm install @augejs/schedule
```

## Usage

```typescript
import { Application, Logger, ILogger, ConsoleLogTransport, boot, GetLogger , Config} from '@augejs/core';
import { ScheduleModule, Schedule } from './main';

Logger.addTransport(new ConsoleLogTransport());

const logger:ILogger = Logger.getLogger('app');

@Application({
  subModules: [
    ScheduleModule,
  ]
})
@Config({
  every5Sec: '*/5 * * * * *'
})
class AppModule {

  @GetLogger()
  logger!:ILogger;

  @Schedule('*/20 * * * * *')
  async every20Sec() {
    logger.info('every20Sec tick');
  }

  @Schedule(config => config.every5Sec)
  async every5SecFromConfig() {
    logger.info('every5SecFromConfig tick');
  }

  @Schedule(`*/4 * * * * *`)
  async every4SecWithLongTime() {
    await new Promise(resolve => {
      setTimeout(resolve, 8000);
    });
  }

  async onInit() {
    logger.info('app on onInit');
  }
}

async function main() {
  await boot(AppModule);
}

main();

```

---
_Source: https://npm.io/package/@augejs/schedule · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
