Insights for npm packages

Guillaume Morin
Jun 22, 2018 · 2 min read
Photo by chuttersnap on Unsplash

I have already published several packages and each time, I’ve been a bit frustrated that I can’t easily visualize, in real-time, how this package is used over time and versions.

So, I decided to make a small web app (http://npm-insights-app.now.sh) for that and I really hope that this tool will be useful for you too.

Here is informations you will be able to see on npm-insights:

  • In which packages your package have been installed;
  • Platform informations (Platform, OS, Node/npm versions, etc …);
  • Downloads by versions;
  • Downloads on last day, week and month.

If you want to use npm-insights for your package, that’s quite simple.

Installation

Install npm-insights into the package you want to get analytics for.

npm i --save npm-insights

Configuration

Add a postinstall script to your package.json ”scripts” section


"scripts": {
"postinstall": "npm-insights:log"
}

⚠️ Then bump the version of your package and publish to npm registry the new version with npm-insights ⚠️

Visualization

That’s it! Go to https://npm-insights-app.now.sh/[your_package_name] (like https://npm-insights-app.now.sh/react-styled-toggle for example) and you should now be able to visualize something like this:

Stack

npm-insights is built with:

Search is provided by Algolia
GraphQL backend is provided by Graphcool

If you have suggestions, if you think something is missing or buggy or if you just want to tell me what you think about this, I would be very happy to hear from you!

Cheers,
Guillaume

DailyJS

JavaScript news and opinion.

Guillaume Morin

Written by

Lead Mobile engineer @slite Ex Lead front-end developer @Adotmob, front-end developer @Deezer and @TagPay github.com/guillaumemorin

DailyJS

DailyJS

JavaScript news and opinion.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade