CrontabStandard 2.0.0
dotnet add package CrontabStandard --version 2.0.0
NuGet\Install-Package CrontabStandard -Version 2.0.0
<PackageReference Include="CrontabStandard" Version="2.0.0" />
paket add CrontabStandard --version 2.0.0
#r "nuget: CrontabStandard, 2.0.0"
// Install CrontabStandard as a Cake Addin
#addin nuget:?package=CrontabStandard&version=2.0.0
// Install CrontabStandard as a Cake Tool
#tool nuget:?package=CrontabStandard&version=2.0.0
Simple crontab
Welcome and thanks for choosing this project out of the various implementations! This library is a simple implementation of a crontab string parser, its only job is to receive a string that follows the crontab format (see https://crontab.guru/ for an amazing editor) and return the time in milliseconds to the closest execution. As of writing of this readme only these Commands are available for use (which should cover most cases to be fair), but still if you have any suggestions for other commands you can open an issue on GitHub and I'll have a look at it.
Capabilities
What does this project do and not do:
Does:
- Split and parse a crontab format string
- Returns the time in milliseconds to the closest execution time
- Does this very fast
Doesn't:
- Queue code executions
- Solve all your problems magically
- Pay for my bills
Advantages
What advantages does using this implementation over others provide? Well simple:
- It's a lightweight implementation
- It's fast
- Does not have any external dependencies
- You can decide what to do with the output instead of being locked to a Timer
Disadvantages
Well, due to it being a basic implementation if you need something that already has a timer or has some more advanced features (like automatically executing a method after a certain time) you might be better off using another implementation
Commands
Here's the list of the current crontab commands available to use on your strings:
- * : Allows for all values
- , : Allows for multiple specific values given
- - : Specifies a range
- / : Specifies the value is divisible by a certain number (example: */5, every number divisible by 5, so 0,5,10...)
How to use
Easy! Just:
- Import the package (either from nuget.org or manually installed)
- Add the using to your desired class (something like "using Crontab")
- And call Crontab.Crontab.CrontabTimeParser(<YOUR-STRING-HERE>);
Roadmap
Currently I'm not expecting to add anything specifically, I'll be waiting to see what bugs you find and what ideas are given to improve the project
Technical data
Things to keep in mind about the project:
- Due to the delay between the result of the crontab being given and your implementation using that data your timer might be off by a little bit, to get the most accurate execution try to use the CrontabTimeParser method as close as possible to when you're gonna use that data
- Days of week start as Sunday = 0 because of the DateTime.DayOfWeek enum implementation, that also means that the crontab string has the same format as typical implementations
- If you're gonna use that time to create a C# timer, its max size is 2,147,483,647 or about 25 days, so check the result from the crontab parsing or the Timer will throw an error 😉
- Yes I do understand that my code is not very easy to read or is visually appealing to most, but that's how my brain works so
Disclaimer
This software is provided "as is" without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- No dependencies.
-
.NETStandard 2.1
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
2.0.0 | 63 | 5/15/2024 |