Node-Cron 2.0 is released!
In February 2016 I created a script for task scheduling in node.js, then I decided to search about that and I find some libraries, but the libs are using many dependencies to execute schedule a task. I don’t think is necessary to use many dependencies to do a simple thing. So, I decided to create my first node.js module to learn more about node.js and how to release that at npm.
I created a simple script for job scheduling and shipped it. I’ve created a readme, generated a Github page and posted that at Reddis.
So was that my first node module was released! And because of that, I went to bed happy. To my surprise in the next day, I receive some comments… And many starts at Github. Wow! In the next day more stars, and more in the next day.
I received more than 200 starts and I was very proud of that, but with the stars, I started to receive some issues :). I’ve fixed the easy ones, and my focus was not on my project anymore…
After 2 years node-cron
received 600+ stars and I realize that I probably have more code running in production environments through node-cron
than the code that I write at my work. And because of that, I decided to write a new version of node-cron
. And this is the release notes:
-
Added timezone support: I added that through the lib tz-offset, a lightweight lib to handle timezones with JavaScript.
-
Added a getStatus to the scheduled task: Now is possible to get the current status of a task.
-
immediateStart is deprecated: The last parameter was a flag, and I think passing flags is not a good thing to do. So, I’ve moved and renamed the immediateStart flag(but still working at version 2.0) to the option
scheduled
, this way more options may be passed to the scheduled task, for example, thetimezone
. -
An internal refactor: Now a task may return a
Promise
this isnode-cron
best practice for two reasons. First: you may write async functions as non-blocking I/O is a best practice for node-js. Second: the status will be more consistent.
I know this is a very short list but is that now node-cron
is a little better, and I may say:
Node-Cron 2.0 is released!