Gathering detailed insights and metrics for cronstrue-zh_cn
Gathering detailed insights and metrics for cronstrue-zh_cn
Gathering detailed insights and metrics for cronstrue-zh_cn
Gathering detailed insights and metrics for cronstrue-zh_cn
JavaScript library that converts CRON expressions into human readable descriptions
npm install cronstrue-zh_cn
Typescript
Module System
Node Version
NPM Version
74.2
Supply Chain
99.4
Quality
75.4
Maintenance
100
Vulnerability
100
License
TypeScript (96.44%)
JavaScript (3.56%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
2 Stars
488 Commits
1 Watchers
11 Branches
1 Contributors
Updated on Mar 08, 2023
Latest Version
1.60.7
Package Id
cronstrue-zh_cn@1.60.7
Unpacked Size
300.00 kB
Size
45.57 kB
File Count
43
NPM Version
3.10.10
Node Version
8.14.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
cRonstrue is a JavaScript library that parses a cron expression and outputs a human readable description of the cron schedule. For example, given the expression "*/5 * * * *" it will output "Every 5 minutes".
This library was ported from the original C# implemenation called cron-expression-descriptor and is also available in a few other languages.
cRonstrue is exported as an UMD module so it will work in an AMD, CommonJS or browser global context.
First, install the module:
npm i cronstrue-zh_cn
Then, depending upon your usage context, add a reference to it:
1var cronstrue = require('cronstrue-zh_cn');
1import cronstrue from 'cronstrue-zh_cn';
The cronstrue-zh_cn.min.js
file from the /dist
folder in the npm package should be served to the browser. There are no dependencies so you can simply include the library in a <script>
tag.
1<script src="cronstrue-zh_cn.min.js" type="text/javascript"></script> 2<script> 3 var cronstrue = window.cronstrue; 4</script>
A simple way to load the library in a browser is by using the unpkg CDN, which is a "fast, global content delivery network for everything on npm". To use it, include a script tag like this in your file:
<script src="https://unpkg.com/cronstrue@latest/dist/cronstrue.min.js" async></script>
Using the "latest" tag will result in a 302 redirect to the latest version tag so it is highly recommended to use a specific version tag such as https://unpkg.com/cronstrue@1.48.0/dist/cronstrue.min.js to avoid this redirect.
1cronstrue.toString("* * * * *"); 2> "Every minute" 3 4cronstrue.toString("0 23 ? * MON-FRI"); 5> "At 11:00 PM, Monday through Friday" 6 7cronstrue.toString("23 12 * * SUN#2"); 8> "At 12:23 PM, on the second Sunday of the month" 9 10cronstrue.toString("23 14 * * SUN#2", { use24HourTimeFormat: true }); 11> "At 14:23, on the second Sunday of the month" 12 13cronstrue.toString("* * * ? * 2-6/2", { dayOfWeekStartIndexZero: false }); 14> "Every second, every 2 days of the week, Monday through Friday"
For more usage examples, including a demonstration of how cRonstrue can handle some very complex cron expressions, you can reference the unit tests.
A demo is available here here.
To use the i18n support cRonstrue provides, you must use the packaged library that contains the locale transalations. Once you do this, you can pass the name of a supported locale as an option to cronstrue.toString()
. For example, for the es (Spanish) locale, you would use: cronstrue.toString("* * * * *", { locale: "es" });
.
1var cronstrue = require('cronstrue/i18n'); 2cronstrue.toString("*/5 * * * *", { locale: "fr" });
The cronstrue-i18n.min.js
file from the /dist
folder in the npm package should be served to the browser.
1<script src="cronstrue-i18n.min.js" type="text/javascript"></script> 2<script> 3 cronstrue.toString("*/5 * * * *", { locale: "fr" }); 4</script>
cRonstrue is freely distributable under the terms of the MIT license.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
security policy file detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
111 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More