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

@changesets/get-github-info

v1.0.1

Published

Get the GitHub username and PR number from a commit. Intended for use with changesets.

Downloads

4,701,983

Readme

@changesets/get-github-info

Open on npmx.dev View changelog

Get GitHub author and associated PR information for a commit or pull request. Intended for use with changesets.

Getting Started

Note: This assumes you already have changesets setup.

You can use @changesets/get-github-info like this if you have a custom changelog formatter.

import { getCommitInfo } from "@changesets/get-github-info";

// ...

const getReleaseLine = async (changeset, type) => {
  const [firstLine, ...futureLines] = changeset.summary
    .split("\n")
    .map((l) => l.trimEnd());

  const info = await getCommitInfo({
    // replace this with your own repo
    repo: "changesets/changesets",
    commit: changeset.commit,
  });
  if (info == null) {
    // may be null if referenced the wrong repo, or the commit has not been pushed
    // to the repo yet
    throw new Error(`Could not get GitHub info for commit ${changeset.commit}`);
  }

  let returnVal = `- [${changeset.commit.sha.slice(0, 7)}](${info.commit.url})`;
  if (info.pull != null) {
    returnVal += ` ([#${info.pull.number}](${info.pull.url})`;
  }
  if (info.author != null) {
    returnVal += ` Thanks [@${info.author.login}](${info.author.url})!`;
  }
  returnVal += `: ${firstLine}`;
  if (futureLines.length > 0) {
    returnVal += `\n${futureLines.map((l) => `  ${l}`).join("\n")}`;
  }
  return returnVal;
};

// ...

You'll need to get a GitHub personal access token with read:user and repo:status permissions, and add it to a .env file (it'll be loaded automatically).

GITHUB_TOKEN=token_here

You can now bump your packages and changelogs with changeset version and it'll have the GitHub info. 🎉

GitHub Enterprise Server

If you are using GitHub Enterprise Server, you can configure @changesets/get-github-info to point at it using the following environment variables:

GITHUB_SERVER_URL=https://github.example.com
GITHUB_GRAPHQL_URL=https://github.example.com/api/graphql

When using GitHub Actions, these environment variables will already have been set.