cronstrue 3.48.0 → 3.49.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +76 -60
  2. package/package.json +1 -3
package/README.md CHANGED
@@ -1,4 +1,11 @@
1
- # cRonstrue ![Build Status](https://github.com/bradymholt/cRonstrue/workflows/Build/badge.svg) [![NPM Package](https://img.shields.io/npm/v/cronstrue.svg)](https://www.npmjs.com/package/cronstrue)
1
+ # cRonstrue
2
+
3
+ [![Build](https://img.shields.io/github/actions/workflow/status/bradymholt/cRonstrue/build.yml?branch=main&label=build)](https://github.com/bradymholt/cRonstrue/actions/workflows/build.yml)
4
+ [![npm version](https://img.shields.io/npm/v/cronstrue.svg)](https://www.npmjs.com/package/cronstrue)
5
+ [![npm downloads](https://img.shields.io/npm/dm/cronstrue.svg)](https://www.npmjs.com/package/cronstrue)
6
+ [![Bundle size](https://img.shields.io/bundlejs/size/cronstrue)](https://bundlejs.com/?q=cronstrue)
7
+ [![Types](https://img.shields.io/npm/types/cronstrue.svg)](https://www.npmjs.com/package/cronstrue)
8
+ [![License: MIT](https://img.shields.io/npm/l/cronstrue.svg)](https://github.com/bradymholt/cRonstrue/blob/main/LICENSE)
2
9
 
3
10
  <img align="left" src="https://user-images.githubusercontent.com/759811/210273710-b13913e2-0a71-4d9d-94da-1fe538b8a73e.gif"/>
4
11
 
@@ -10,19 +17,25 @@
10
17
 
11
18
  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".
12
19
 
13
- This library was ported from the original C# implementation called [cron-expression-descriptor](https://github.com/bradymholt/cron-expression-descriptor) and is also available in a [few other languages](https://github.com/bradymholt/cron-expression-descriptor#ports).
20
+ ```js
21
+ cronstrue.toString("*/5 * * * *"); // "Every 5 minutes"
22
+ cronstrue.toString("0 23 ? * MON-FRI"); // "At 11:00 PM, Monday through Friday"
23
+ cronstrue.toString("0 9 * * 1", { locale: "fr" }); // "À 09:00, uniquement le lundi"
24
+ ```
25
+
26
+ **[Try it in the live demo →](https://bradymholt.github.io/cRonstrue/)**
27
+
28
+ This library was ported from the original C# implementation called [cron-expression-descriptor](https://github.com/bradymholt/cron-expression-descriptor) and is also available in [Java, Python, Ruby, Go, PHP, Rust, Swift and more](https://github.com/bradymholt/cron-expression-descriptor#ports).
14
29
 
15
30
  ## Features
16
31
  - Zero dependencies
32
+ - TypeScript type definitions included
17
33
  - Supports all cron expression special characters including * / , - ? L W, #
18
34
  - Supports 5, 6 (w/ seconds or year), or 7 (w/ seconds and year) part cron expressions
19
- - [Quartz Job Scheduler](http://www.quartz-scheduler.org/) cron expressions are supported
20
- - Supports time specification _nicknames_ (@yearly, @annually, @monthly, @weekly, @daily)
35
+ - [Quartz Job Scheduler](https://www.quartz-scheduler.org/) cron expressions are supported
36
+ - Supports time specification _nicknames_ (@yearly, @annually, @monthly, @weekly, @daily, @midnight, @hourly, @reboot)
21
37
  - i18n support with 40+ languages
22
-
23
- ## Demo
24
-
25
- A demo is available [here](http://bradymholt.github.io/cRonstrue/#cronstrue-demo).
38
+ - CLI: `npx cronstrue "*/5 * * * *"`
26
39
 
27
40
  ## Installation
28
41
  cRonstrue is exported as an [UMD](https://github.com/umdjs/umd) module so it will work in an [AMD](https://github.com/amdjs/amdjs-api/wiki/AMD), [CommonJS](http://wiki.commonjs.org/wiki/CommonJS) or browser global context.
@@ -66,7 +79,7 @@ A simple way to load the library in a browser is by using the [unpkg](https://un
66
79
  <script src="https://unpkg.com/cronstrue@latest/dist/cronstrue.min.js" async></script>
67
80
  ```
68
81
 
69
- Using the "latest" tag will result in a 302 redirect to the latest version tag so it is recommended to use a specific version tag such as https://unpkg.com/cronstrue@1.48.0/dist/cronstrue.min.js to avoid this redirect.
82
+ Using the "latest" tag will result in a 302 redirect to the latest version tag so it is recommended to use a specific version tag such as https://unpkg.com/cronstrue@3.48.0/dist/cronstrue.min.js to avoid this redirect.
70
83
 
71
84
  ## Usage
72
85
 
@@ -128,7 +141,7 @@ To use the i18n support cRonstrue provides, you can either import all the suppor
128
141
 
129
142
  ### All Locales
130
143
 
131
- You can import all locales at once with `cronstrue/i18n`. This approach has the advantage of only having to load one module and having access to all supported locales. The tradeoff with this approach is a larger module (~130k, minified) that will take longer to load, particularly when sending down to a browser.
144
+ You can import all locales at once with `cronstrue/i18n`. This approach has the advantage of only having to load one module and having access to all supported locales. The tradeoff with this approach is a larger module (~190k, minified) that will take longer to load, particularly when sending down to a browser.
132
145
 
133
146
  ```js
134
147
  // Node / CommonJS
@@ -138,7 +151,7 @@ const cronstrue = require('cronstrue/i18n');
138
151
  import cronstrue from 'cronstrue/i18n';
139
152
 
140
153
  // Browser
141
- <script src="https://unpkg.com/cronstrue@latest/cronstrue-i18n.min.js" async></script>
154
+ <script src="https://unpkg.com/cronstrue@latest/dist/cronstrue-i18n.min.js" async></script>
142
155
 
143
156
  cronstrue.toString("*/5 * * * *", { locale: "fr" }); // => Toutes les 5 minutes
144
157
  cronstrue.toString("*/5 * * * *", { locale: "es" }); // => Cada 5 minutos
@@ -146,7 +159,7 @@ cronstrue.toString("*/5 * * * *", { locale: "es" }); // => Cada 5 minutos
146
159
 
147
160
  ### Individual Locales
148
161
 
149
- You can also load the main cronstrue module and then load individual locale modules you want to have access to. This works well when you have one or more locales you know you need access to and want to minimize load time, particularly when sending down to a browser. The main cronstrue module is about 42k (minified) and each locale is about 4k (minified) in size.
162
+ You can also load the main cronstrue module and then load individual locale modules you want to have access to. This works well when you have one or more locales you know you need access to and want to minimize load time, particularly when sending down to a browser. The main cronstrue module is about 26k (minified) and each locale is about 5k (minified) in size.
150
163
 
151
164
  ```js
152
165
  // Node / CommonJS
@@ -172,47 +185,50 @@ cronstrue.toString("*/5 * * * *", { locale: "es" }); // => Cada 5 minutos
172
185
 
173
186
  The following locales can be passed in for the `locale` option. Thank you to the author (shown below) of each translation!
174
187
 
175
- - en - English ([Brady Holt](https://github.com/bradymholt))
176
- - af - Afrikaans ([Michael van Niekerk](https://github.com/mvniekerk))
177
- - ar - Arabic ([Mohamed Nehad Shalabi](https://github.com/mohamednehad450))
178
- - az - Azerbaijani ([Jamal Kamaladdin](https://github.com/jamalkamaladdin))
179
- - be - Belarusian ([Kirill Mikulich](https://github.com/KirillMikulich))
180
- - bg - Bulgarian ([kamenf](https://github.com/kamenf))
181
- - ca - Catalan ([Francisco Javier Barrena](https://github.com/fjbarrena))
182
- - cs - Czech ([hanbar](https://github.com/hanbar))
183
- - da - Danish ([Rasmus Melchior Jacobsen](https://github.com/rmja))
184
- - de - German ([Michael Schuler](https://github.com/mschuler))
185
- - es - Spanish ([Ivan Santos](https://github.com/ivansg))
186
- - fa - Farsi ([A. Bahrami](https://github.com/alirezakoo))
187
- - fi - Finnish ([Mikael Rosenberg](https://github.com/MR77FI))
188
- - fr - French ([Arnaud TAMAILLON](https://github.com/Greybird))
189
- - he - Hebrew ([Ilan Firsov](https://github.com/IlanF))
190
- - hr - Croatian ([Rok Šekoranja](https://github.com/Rookxc))
191
- - hu - Hungarian ([Orcsity Norbert](https://github.com/Northber), Szabó Dániel)
192
- - id - Indonesia ([Hasan Basri](https://github.com/hasanbasri1993))
193
- - it - Italian ([rinaldihno](https://github.com/rinaldihno))
194
- - ja - Japanese ([Alin Sarivan](https://github.com/asarivan))
195
- - ko - Korean ([Ion Mincu](https://github.com/ionmincu))
196
- - my - Malay (Malaysia) ([Ikhwan Abdullah](https://github.com/leychay))
197
- - nb - Norwegian ([Siarhei Khalipski](https://github.com/KhalipskiSiarhei))
198
- - nl - Dutch ([TotalMace](https://github.com/TotalMace))
199
- - pl - Polish ([foka](https://github.com/foka))
200
- - pt_BR - Portuguese (Brazil) ([Renato Lima](https://github.com/natenho))
201
- - pt_PT - Portuguese (Portugal) ([POFerro](https://github.com/POFerro))
202
- - ro - Romanian ([Illegitimis](https://github.com/illegitimis))
203
- - ru - Russian ([LbISS](https://github.com/LbISS))
204
- - sk - Slovakian ([hanbar](https://github.com/hanbar))
205
- - sl - Slovenian ([Jani Bevk](https://github.com/jenzy))
206
- - sw - Swahili ([Leylow Lujuo](https://github.com/leyluj))
207
- - sv - Swedish ([roobin](https://github.com/roobin))
208
- - sr - Serbian ([Miloš Paunović](https://github.com/MilosPaunovic))
209
- - tg - Tajik ([Ismoil Vakhidov](https://github.com/ismoil77))
210
- - th - Thai ([Teerapat Prommarak](https://github.com/xeusteerapat))
211
- - tr - Turkish ([Mustafa SADEDİL](https://github.com/sadedil))
212
- - uk - Ukrainian ([Taras](https://github.com/tbudurovych))
213
- - vi - Vietnamese ([Nguyen Tan Phap](https://github.com/rikkapro0128))
214
- - zh_CN - Chinese (Simplified) ([Star Peng](https://github.com/starpeng))
215
- - zh_TW - Chinese (Traditional) ([Ricky Chiang](https://github.com/metavige))
188
+ | Code | Language | Translated by |
189
+ | --- | --- | --- |
190
+ | `en` | English | [Brady Holt](https://github.com/bradymholt) |
191
+ | `af` | Afrikaans | [Michael van Niekerk](https://github.com/mvniekerk) |
192
+ | `ar` | Arabic | [Mohamed Nehad Shalabi](https://github.com/mohamednehad450) |
193
+ | `az` | Azerbaijani | [Jamal Kamaladdin](https://github.com/jamalkamaladdin) |
194
+ | `be` | Belarusian | [Kirill Mikulich](https://github.com/KirillMikulich) |
195
+ | `bg` | Bulgarian | [kamenf](https://github.com/kamenf) |
196
+ | `ca` | Catalan | [Francisco Javier Barrena](https://github.com/fjbarrena) |
197
+ | `cs` | Czech | [hanbar](https://github.com/hanbar) |
198
+ | `da` | Danish | [Rasmus Melchior Jacobsen](https://github.com/rmja) |
199
+ | `de` | German | [Michael Schuler](https://github.com/mschuler) |
200
+ | `es` | Spanish | [Ivan Santos](https://github.com/ivansg) |
201
+ | `fa` | Farsi | [A. Bahrami](https://github.com/alirezakoo) |
202
+ | `fi` | Finnish | [Mikael Rosenberg](https://github.com/MR77FI) |
203
+ | `fr` | French | [Arnaud TAMAILLON](https://github.com/Greybird) |
204
+ | `he` | Hebrew | [Ilan Firsov](https://github.com/IlanF) |
205
+ | `hr` | Croatian | [Rok Šekoranja](https://github.com/Rookxc) |
206
+ | `hu` | Hungarian | [Orcsity Norbert](https://github.com/Northber), Szabó Dániel |
207
+ | `id` | Indonesian | [Hasan Basri](https://github.com/hasanbasri1993) |
208
+ | `it` | Italian | [rinaldihno](https://github.com/rinaldihno) |
209
+ | `ja` | Japanese | [Alin Sarivan](https://github.com/asarivan) |
210
+ | `ko` | Korean | [Ion Mincu](https://github.com/ionmincu) |
211
+ | `my` | Malay (Malaysia) | [Ikhwan Abdullah](https://github.com/leychay) |
212
+ | `nb` | Norwegian (Bokmål) | [Siarhei Khalipski](https://github.com/KhalipskiSiarhei) |
213
+ | `nn` | Norwegian (Nynorsk) | [Arvind](https://github.com/arvindfroi) |
214
+ | `nl` | Dutch | [TotalMace](https://github.com/TotalMace) |
215
+ | `pl` | Polish | [foka](https://github.com/foka) |
216
+ | `pt_BR` | Portuguese (Brazil) | [Renato Lima](https://github.com/natenho) |
217
+ | `pt_PT` | Portuguese (Portugal) | [POFerro](https://github.com/POFerro) |
218
+ | `ro` | Romanian | [Illegitimis](https://github.com/illegitimis) |
219
+ | `ru` | Russian | [LbISS](https://github.com/LbISS) |
220
+ | `sk` | Slovak | [hanbar](https://github.com/hanbar) |
221
+ | `sl` | Slovenian | [Jani Bevk](https://github.com/jenzy) |
222
+ | `sw` | Swahili | [Leylow Lujuo](https://github.com/leyluj) |
223
+ | `sv` | Swedish | [roobin](https://github.com/roobin) |
224
+ | `sr` | Serbian | [Miloš Paunović](https://github.com/MilosPaunovic) |
225
+ | `tg` | Tajik | [Ismoil Vakhidov](https://github.com/ismoil77) |
226
+ | `th` | Thai | [Teerapat Prommarak](https://github.com/xeusteerapat) |
227
+ | `tr` | Turkish | [Mustafa SADEDİL](https://github.com/sadedil) |
228
+ | `uk` | Ukrainian | [Taras](https://github.com/tbudurovych) |
229
+ | `vi` | Vietnamese | [Nguyen Tan Phap](https://github.com/rikkapro0128) |
230
+ | `zh_CN` | Chinese (Simplified) | [Star Peng](https://github.com/starpeng) |
231
+ | `zh_TW` | Chinese (Traditional) | [Ricky Chiang](https://github.com/metavige) |
216
232
 
217
233
  ## Frequently Asked Questions
218
234
 
@@ -242,7 +258,7 @@ The following locales can be passed in for the `locale` option. Thank you to th
242
258
 
243
259
  2. Can cRonstrue output the next occurrence of the cron expression?
244
260
 
245
- No, cRonstrue does not support this. This library simply describes a cron expression that is passed in. You can do with with a library like [croner](https://www.npmjs.com/package/croner). Example:
261
+ No, cRonstrue does not support this. This library simply describes a cron expression that is passed in. You can do this with a library like [croner](https://www.npmjs.com/package/croner). Example:
246
262
 
247
263
  ```javascript
248
264
  import { Cron } from 'croner';
@@ -255,12 +271,12 @@ The following locales can be passed in for the `locale` option. Thank you to th
255
271
 
256
272
  Thank you to the following sponsors of this project!
257
273
 
258
- <a href="https://github.com/microsoft"><img src="https://github.com/microsoft.png" width="50px" alt="robjtede" style="max-width: 100%;"></a>
259
- <a href="https://github.com/github"><img src="https://github.com/github.png" width="50px" alt="robjtede" style="max-width: 100%;"></a>
260
- <a href="https://github.com/DevUtilsApp"><img src="https://github.com/DevUtilsApp.png" width="50px" alt="robjtede" style="max-width: 100%;"></a>
261
- <a href="https://github.com/getsentry"><img src="https://github.com/getsentry.png" width="50px" alt="robjtede" style="max-width: 100%;"></a>
262
- <a href="https://github.com/KevinWang15"><img src="https://github.com/KevinWang15.png" width="50px" alt="robjtede" style="max-width: 100%;"></a>
263
- <a href="https://github.com/timheuer"><img src="https://github.com/timheuer.png" width="50px" alt="robjtede" style="max-width: 100%;"></a>
274
+ <a href="https://github.com/microsoft"><img src="https://github.com/microsoft.png" width="50px" alt="microsoft" style="max-width: 100%;"></a>
275
+ <a href="https://github.com/github"><img src="https://github.com/github.png" width="50px" alt="github" style="max-width: 100%;"></a>
276
+ <a href="https://github.com/DevUtilsApp"><img src="https://github.com/DevUtilsApp.png" width="50px" alt="DevUtilsApp" style="max-width: 100%;"></a>
277
+ <a href="https://github.com/getsentry"><img src="https://github.com/getsentry.png" width="50px" alt="getsentry" style="max-width: 100%;"></a>
278
+ <a href="https://github.com/KevinWang15"><img src="https://github.com/KevinWang15.png" width="50px" alt="KevinWang15" style="max-width: 100%;"></a>
279
+ <a href="https://github.com/timheuer"><img src="https://github.com/timheuer.png" width="50px" alt="timheuer" style="max-width: 100%;"></a>
264
280
 
265
281
 
266
282
  ## License
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cronstrue",
3
3
  "title": "cRonstrue",
4
- "version": "3.48.0",
4
+ "version": "3.49.0",
5
5
  "description": "Convert cron expressions into human readable descriptions",
6
6
  "author": "Brady Holt",
7
7
  "license": "MIT",
@@ -21,8 +21,6 @@
21
21
  "cron for humans",
22
22
  "cron translated",
23
23
  "cron english",
24
- "cron schedule",
25
- "cron english",
26
24
  "cron schedule"
27
25
  ],
28
26
  "main": "dist/cronstrue.js",