Member-only story

Sometimes You Just Need A Dumb Library

How to create a library with Rollup and Typescript

David Dal Busco
4 min readMar 19, 2020
Photo by Benjamin Davies on Unsplash

I challenged my self to share a blog post every day until end of the current quarantine in Switzerland, the 19th April 2020. Thirty-one days left until hopefully better days.

One of my client week’s assignment was to track down a bug between libraries. After quite a bit of time, I finally figured out that some code had been duplicated and had also received, of course, an improvement which had not been spread 😒.

Such issues can be avoided by not duplicating code, for example, by sharing it across projects through libraries. But often, if it is not yet something standardized in your company, it will take a bit of time to setup such new libraries.

Because in DeckDeckGo, our open source editor for presentations, we actually had already setup such utilities, I thought it would be not a bad thing to share our recipe.

Our Goal: A Utility To Get Valid Date Objects

Regardless of the JavaScript projects and the frameworks, at some point, I will most probably have to handle dates and most probably, I will have to cast these to proper JavaScript Date objects, or at least, have to ensure their validities. That’s why I created for my self a little…

--

--

David Dal Busco
David Dal Busco

Written by David Dal Busco

Freelancer by day | Creator of Juno.build by night

No responses yet