Koa and Express. Power and customizability vs simplicity.

Matt Macdonald
3 min readAug 22, 2021

If you’ve found yourself here, you’re likely trying to serve a webpage or move information across the internet. It’s difficult to know how to choose the best framework for your project. With so many options these days, it’s easy to get decision paralysis. We’re going to help you with this problem and make the choice a little easier.

Koa.js is a minimal and flexible Node.js web application framework designed and created by the same team behind Express JS. Express JS is a long-standing and extremely popular framework that makes it simple to create a web-connected application. This highly successful team started Koa using similar principles to Express but leveraged the newer functions available in ES2017 to add things such as async to avoid callback hell and a function generator to develop faster than previously possible.

Having a look at npmjs.com, we can see Koa is still on its rise to fame. It currently only has 913,000 weekly downloads vs express’s 16,728,000. Express JS also has heavy hitters behind it, such as Twitter and Accenture according to stackshare.io, as well as a massive community for support. Koa lacks a proven track record among larger companies, being found primarily in startups. Koa also has a smaller community and less support. If you’re choosing a tech stack for a less experienced development team, you may want to consider Express instead.

Koa is a lightweight middleware. It is only around 500 lines of code in its entirety. This means if you’re not concerned about serving web pages, it gets very attractive very quickly. If your application is concerned about performance, this is the way to go. You will be able to achieve more, using fewer resources and have better responsivity. Express on the other hand includes a view engine, templates and a router. However, Koa has these available as added modules. You will have to take time to choose which modules are best for you and understand why. If you’re not ready to decide that for yourself yet, or you want to keep it simple, choose Express. If you want high customizability or performance, choose Koa.

We hope this has made the decision a little bit easier. While your project will likely succeed with either Koa or Express, there are compelling reasons to choose one over the other. Koa is less proven, has less support, and will need more work and further modules to get a website delivered. That being said, it is lightweight, high-performance, highly customizable, and the team that developed it had more experience than they did when Express was created. On the other hand, Express is very easy to use. It has everything needed to route and serve a website including features like Jsonp right out of the box. It’s trusted for large complicated tech stacks by major industry players. It has a tremendous community and you will find documentation, examples and support abound. If you want more possibilities and are comfortable on the fringe, go with Koa. If you want to keep your project simple or are a newer developer, go with express.

--

--

Matt Macdonald
0 Followers

Matt Macdonald is a Full Stack Web Developer based out of Vancouver, Canada