npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@hr222sy/subscription-tracker

v1.0.0

Published

A JavaScript module for managing and analyzing personal subscriptions with cost calculations and usage tracking

Readme

Subscription Tracker

⚠️ Disclaimer: This is my first module, built for a school assignment and clean code practice. It may not be fully polished.

A JavaScript module for managing and analyzing personal subscriptions. Convert between billing frequencies, identify unused services, analyze cost efficiency and make calculated decisions about which subscriptions to keep or cancel.

Core Features

  • ✅ Manage subscription data with validation
  • ✅ Convert costs between weekly/monthly/yearly frequencies
  • ✅ Track active/inactive status and usage hours
  • ✅ Calculate individual and total costs by category
  • ✅ Analyze usage efficiency (cost per hour)
  • ✅ Identify completely unused subscriptions
  • ✅ Identify underutilized subscriptions

Purpose

Subscription Tracker helps individuals take control of their subscription expenses by providing clear insights into spending patterns. This module is designed for both end-users managing personal subscriptions and developers who need subscription management functionality in their applications. The module addresses common problems:

  • Converting between different billing frequencies for fair cost comparison
  • Identifying unused subscriptions costing you money
  • Finding overpriced services relative to your usage
  • Calculating total spending across categories
  • Making calculated analysis of which subscriptions to keep or cancel

Table of Contents

Quick Start

import { Subscription, SubscriptionCollection, CostCalculator, UsageAnalyzer } from 'subscription-tracker'

// Create and manage subscriptions
const netflix = new Subscription("Netflix", 139, "monthly", "streaming")
const collection = new SubscriptionCollection()
collection.addSubscription(netflix)

// Calculate costs
const calculator = new CostCalculator()
const yearlyCost = calculator.calculateYearlyCost(netflix)
console.log(`Netflix yearly cost: ${yearlyCost} kr`)

// Track and analyze usage
netflix.addUsageHours(25)
const analyzer = new UsageAnalyzer()
const costPerHour = analyzer.analyzeCostPerHour(netflix, calculator)
console.log(`Cost per hour: ${costPerHour.toFixed(2)} kr`)

Installation

# Clone from GitHub
git clone https://github.com/HannaRV/subscription-tracker

Essential API

⚠️ Note: Each class has important usage considerations. See complete API documentation for detailed behavior notes and limitations.

Subscription → Complete Subscription API

const subscription = new Subscription(name, price, frequency, category)
subscription.activate()
subscription.deactivate()
subscription.addUsageHours(hours)

SubscriptionCollection → Complete SubscriptionCollection API

const collection = new SubscriptionCollection()
collection.addSubscription(subscription)
collection.getActiveSubscriptions()
collection.searchSubscriptionsByName(name)

CostCalculator → Complete CostCalculator API

const calculator = new CostCalculator()
calculator.calculateMonthlyCost(subscription)
calculator.calculateTotalMonthlyCost(subscriptions)
calculator.calculateCostByCategory(subscriptions)

UsageAnalyzer → Complete UsageAnalyzer API

const analyzer = new UsageAnalyzer()
analyzer.analyzeCostPerHour(subscription, calculator)
analyzer.findUnderutilizedSubscriptions(subscriptions, calculator, maxCostPerHour)
analyzer.findUnusedSubscriptions(subscriptions)

Complete Example

// Setup subscriptions
const netflix = new Subscription("Netflix", 139, "monthly", "streaming")
const spotify = new Subscription("Spotify", 1200, "yearly", "music")

const collection = new SubscriptionCollection()
collection.addSubscription(netflix)
collection.addSubscription(spotify)

// Add usage data
netflix.addUsageHours(25)
spotify.addUsageHours(50)

// Calculate and analyze
const calculator = new CostCalculator()
const analyzer = new UsageAnalyzer()

const totalMonthlyCost = calculator.calculateTotalMonthlyCost(collection.getAllSubscriptions())
const categoryBreakdown = calculator.calculateCostByCategory(collection.getAllSubscriptions())
const unusedSubs = analyzer.findUnusedSubscriptions(collection.getAllSubscriptions())
console.log(`Completely unused subscriptions: ${unusedSubs.length}`)
const inefficientSubs = analyzer.findUnderutilizedSubscriptions(
    collection.getAllSubscriptions(),
    calculator,
    20 // Max 20 kr/hour
)

console.log(`Total monthly cost: ${totalMonthlyCost} kr`)
console.log('By category:', categoryBreakdown)
console.log(`Inefficient subscriptions: ${inefficientSubs.length}`)

Requirements

  • Language: JavaScript (ES2020+)
  • Runtime: Node.js >=20.6.0
  • Module system: ES6 modules

License

MIT

Versioning

This project uses Semantic Versioning:

  • MAJOR version for incompatible API changes
  • MINOR version for new functionality
  • PATCH version for bug fixes

Current version: 1.0.0

Author

Hanna Rubio Vretby [email protected]