# think-crontab

> crontab for thinkjs

Latest version **1.0.4** (published 2017-07-27) · 0 weekly downloads

## Install

```sh
npm install think-crontab
pnpm add think-crontab
yarn add think-crontab
bun add think-crontab
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2017-07-27 |
| First published | 2017-05-15 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=6.0.0 |
| Dependencies | 5 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | welefen |
| Maintainers | welefen, zhengqingxin |

## Links

- npm: https://www.npmjs.com/package/think-crontab
- Repository: https://github.com/thinkjs/think-crontab
- Homepage: https://github.com/thinkjs/think-crontab#readme
- Issues: https://github.com/thinkjs/think-crontab/issues
- npm.io page: https://npm.io/package/think-crontab

## Dependencies (5)

- [debug](https://npm.io/package/debug.md) ^2.6.1
- [think-helper](https://npm.io/package/think-helper.md) ^1.0.0
- [node-schedule](https://npm.io/package/node-schedule.md) ^1.2.1
- [think-cluster](https://npm.io/package/think-cluster.md) ^1.0.0
- [think-mock-http](https://npm.io/package/think-mock-http.md) ^1.0.0

## Recent versions

- 1.0.4 (latest) — 2017-07-27
- 1.0.3 — 2017-07-13
- 1.0.2 — 2017-07-10
- 1.0.1 — 2017-05-22
- 1.0.0 — 2017-05-15

## README

# think-crontab
[![Build Status](https://travis-ci.org/thinkjs/think-crontab.svg?branch=master)](https://travis-ci.org/thinkjs/think-crontab)
[![Coverage Status](https://coveralls.io/repos/github/thinkjs/think-crontab/badge.svg?branch=master)](https://coveralls.io/github/thinkjs/think-crontab?branch=master)
[![npm](https://img.shields.io/npm/v/think-crontab.svg?style=flat-square)](https://www.npmjs.com/package/think-crontab)


## How to use

`src/config/crontab.js`,

```js
module.exports = [{
  interval: '10s',
  immediate: true,
  handle: () => {
    //do something
  }
}, {
  cron: '0 */1 * * *',
  handle: 'crontab/test',
  worker: 'all'
}]
```

### options

* `interval` {String|Number} interval task
* `cron` {String} cron task
* `worker` {String} task type, *one*/*all*, default is one
* `handle` {Function|String} task handle, required
* `immediate` {Boolean} immediate to run task, default is false
* `enable` {Boolean} enable task, default is true

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