3.0.1 • Published 5 years ago

crontab-node v3.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

crontab-node

yarn add crontab-node

crontab-node目的是配合linux的crontab使用, 需要每分钟执行一次,时间触发后才会执行函数方法

kernel

Example

c.js

const crontab = require('crontab-node');
const eventEmitter = require('crontab-node/eventEmitter');

eventEmitter.on('crontab-node exit', () => {
	process.exit(0);
});
const promise = new Promise((resolve, reject) => {
    setTimeout(() => {
      resolve();
    }, 1);
});

console.log(new Date());

crontab('*/2 * * * *', () => {
	return promise.then(() => {
		console.log('I am callback, just excute once');
	});
});

crontab -l

* * * * * node path/c.js
3.0.1

5 years ago

3.0.0

5 years ago

2.0.5

5 years ago

2.0.4

5 years ago

2.0.3

5 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.3.0

6 years ago

1.2.0

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago