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

@musicmedia/next-git-version

v1.0.0

Published

A Next.js component for displaying git version information

Readme

@musicmedia/next-git-version

A Next.js component for displaying git version information in your application.

Features

  • Shows git branch and commit information
  • Real-time updates for uncommitted changes in development
  • Links to GitHub repository
  • Configurable display options
  • Works in both development and production environments
  • Supports Heroku deployments

Installation

npm install @musicmedia/next-git-version

Setup

  1. Add the build script to your package.json:
{
  "scripts": {
    "build": "node node_modules/@musicmedia/next-git-version/dist/scripts/set-git-env.js && next build"
  }
}
  1. Create an API route at app/api/git-info/route.ts:
import { NextResponse } from 'next/server'
import { getGitInfo } from '@musicmedia/next-git-version'
import { headers } from 'next/headers'

export const runtime = 'nodejs'
export const dynamic = 'force-dynamic'

export async function GET() {
  const headersList = headers()
  const accept = headersList.get('accept')

  if (accept === 'text/event-stream') {
    const encoder = new TextEncoder()
    let closed = false

    const stream = new ReadableStream({
      start: async (controller) => {
        while (!closed) {
          try {
            const gitInfo = await getGitInfo()
            const data = encoder.encode(`data: ${JSON.stringify(gitInfo)}\n\n`)
            controller.enqueue(data)
            await new Promise(resolve => setTimeout(resolve, 2000))
          } catch (error) {
            console.error('Error in SSE stream:', error)
            controller.close()
            closed = true
            break
          }
        }
      },
      cancel() {
        closed = true
      }
    })

    return new Response(stream, {
      headers: {
        'Content-Type': 'text/event-stream',
        'Cache-Control': 'no-cache',
        'Connection': 'keep-alive'
      }
    })
  }

  const gitInfo = await getGitInfo()
  return NextResponse.json(gitInfo)
}

Usage

import { GitVersion } from '@musicmedia/next-git-version'

export function Footer() {
  return (
    <footer>
      <GitVersion 
        repoUrl="https://github.com/your-org/your-repo"
        className="text-sm text-gray-500"
        label="Version: "
        showBranch={true}
      />
    </footer>
  )
}

Props

  • repoUrl (required): Your GitHub repository URL
  • className: Custom CSS class for the container
  • showBranch: Whether to show the branch name (defaults to showing only in development)
  • label: Custom label before the version info (defaults to "Version: ")

Environment Variables

For Heroku deployments, set:

  • HEROKU_HOSTED=true
  • HEROKU_BRANCH (optional, defaults to 'main')
  • SOURCE_VERSION (set automatically by Heroku)

License

MIT