Skip to content

ikesnowy/cron-chinese

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cron-chinese

一个将 Cron 转换为中文的工具。

npm

如何使用

npm install cron-chinese
import { humanizeCronInChinese } from "cron-chinese";

humanizeCronInChinese('* * * * *'); // 每分钟
humanizeCronInChinese('0 0 * * *'); // 每日00:00
humanizeCronInChinese('0 0 1 * *'); // 每月1日00:00
humanizeCronInChinese('*/2 * * * *'); // 每隔2分钟
humanizeCronInChinese('45 4 1,10,20 * *') // 每月1,10,20日04:45

更多示例请查看测试文件:index.spec.js