Btw, we just dropped "itty-time" v1 on NPM as a direct rival to the popular "ms" library.
At 386 bytes for the entire library, it handles ms/second conversions (great for TTLs like with KV), creates human-readable durations, and can do readable date math (great for expiration dates).
Ultra-small (~390 bytes) library for TTL date math and converting ms durations to and from strings.. Latest version: 1.0.3, last published: 11 hours ago. Start using itty-time in your project by running
npm i itty-time
npm i itty-time
. There are no other projects in the npm registry using itty-time.