📊 Building downloads-graph: An NPM Package for Download Stats

Published on June 11, 2025

I recently published a reusable React component called downloads-graph, available on NPM. It visualizes daily download counts for any NPM package using Chart.js and React ChartJS 2.

✨ Features

🚀 Installation

npm install downloads-graph

Also install the required peer dependencies:

npm install react react-dom chart.js react-chartjs-2

🛠 Usage

import DownloadsGraph from "downloads-graph";

export default function App() {
  return (
    <div style={{ height: 400 }}>
      <DownloadsGraph
        packageName="react"
        borderColor="blue"
        backgroundColor="rgba(0, 0, 255, 0.2)"
      />
    </div>
  );
}

📦 Props

PropTypeRequiredDescription
packageNamestringNPM package to visualize downloads for
borderColorstringColor of the chart line
backgroundColorstringArea fill under the chart line

🙋‍♂️ Author

Made with ❤️ by Tarun Sai Srinivas. Connect on LinkedIn or explore the package on npm.