TypeScript

TypeScript

TypeScript is an open-source programming language developed and maintained by Microsoft. It is a strict syntactical superset of JavaScript and adds optional static typing to the language. TypeScript is designed for development of large applications and trans-compiles to JavaScript.

I love to use TypeScript for open source packages. It makes programming JavaScript easier and shows intent.

There are 19 articles tagged with TypeScript.

Grafana, I want slugs back for my Hubot! 😭

At Wehkamp, we use the Hubot Grafana project to make our Grafana dashboard available in Slack. It mainly helps our standby team to make quick assessments on what’s going on with our website. Last year, we saw we could not upgrade the package from 2.5.2 to 3.0.1, because slugs could not be used anymore. But we use slugs and… quite heavily! So we did not upgrade our Grafana v7… until we got hit by the input field bug. We decided to see what we could do to bring our slug feature back to our ChatOps bot!

Read the article Grafana, I want slugs back for my Hubot! 😭

Task: take some website screenshots and put them in a folder (in parallel)

You have a bunch of online services that let you take screenshots of a site and save them in a folder. While it can be very useful to pay for such a system, it is not so hard to create it. Let’s use Chrome / Chromium with Puppeteer and Node.js (cluster) to take some snapshots in no-time. We’ll use the Puppeteer Cluster package to run multiple threads / workers to grab those screens in parallel. We’ll be using TypeScript.

Read the article Task: take some website screenshots and put them in a folder (in parallel)

Retry with Exponential Back-Off utility method

Have you tried turning it on and off again? The web is a weird place and calls might not always succeed in the right manner. A retry with an exponential back-off mechanism helps your code to be more resilient when it connects to services outside of your control. While there are many packages that can help in this area, it pretty easy to add some utility methods to your project. In this article I’ll show how you can create a general-purpose exponential back-off and retry mechanism using TypeScript and Node.js.

Read the article Retry with Exponential Back-Off utility method

Having fun grouping arrays into maps with TypeScript

I love the group by SQL command, and sometimes I really miss these SQL-like functions in languages like JavaScript. In this article I explore how to group arrays into maps and how we can transform those maps into structures that work for us. We will leverage TypeScript generics to do transformation on data structures in such a way that the end-result remains strongly typed: this will make your code more maintainable.

Read the article Having fun grouping arrays into maps with TypeScript
expand_less brightness_auto