⌚ Micro library to make working with
If you have ever written something like this
const ONE_DAY = 1000 * 60 * 60 * 24;
... then this micro library is made just for you.
$ npm install --save utils.time
const seconds = ;;//=> 3000
Too often, I saw myself writing code that resembled something like this
const ONE_SECOND = 1000;let twentyFourHours = ONE_SECOND * 60 * 60 * 24;const fn =// some code that runs every 24 hours;;
... and not just in one place, but in several places. At some point, I would just extract all these constants either at the top-level of the module, or just create a small module itself. What you're seeing is the result of the small module I'd end up using in other projects.
NOTE: I'm aware of the awesome library by zeit (
ms), but I felt like it did way more than I needed it to, which is why I decided to publish my version of it. Once again, to reiterate,
ms is great, but I just needed something smaller.