Insights for npm packages

Guillaume Morin
DailyJS
Published in
2 min readJun 22, 2018
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

--

--

Guillaume Morin
DailyJS
Writer for

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