npmstats

Site showing npm download counts

By Dominik Ferber

Curious about how npm's download counts work, I ended up building npmstats.org which lets you view the download history of any package published to npm.

Aside from showing statistics of packages, it can also compare authors. Check out these examples:

Architecture

I took the chance of building a small application to experiment with different frontend technologies. I wrote this project three times: in plain JavaScript, in choo and then finally in preact. Aside from trying out new frontend technologies, I also used the lovely Parcel to bundle the site.

Cloudflare Workers are a new technology simliar to AWS lambda which allow running code on demand. As they use V8 isolates instead of node, they start faster than other cloud functions. They are also deployed around the world automatically, so response times are low. I use them to fetch the download statistics.

Summary

The project ended up more challening than I thought at first. It was a ton of fun nonetheless and I’m very excited to see where Cloudflare Workers are headed.

Open article

Open on GitHub

Dominik Ferber

I'm a freelance Software Engineer and Consultant specialising in React. Since 2015 I've successfully helped enterprise and small companies from all over the world with their frontend work.

Follow me on Twitter