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

@brettz9/git-utilities

v1.7.0

Published

CLI utility scripts for Git

Readme

git-utilities

Install

npm i @brettz9/git-utilities

Use with Sourcetree

You can add to Sourcetree any or all of the following Custom actions (being sure to change the /path/to portion to lead to where @brettz9/git-utilities is hosted.

  • Menu Caption: View File on Github (SHA commit)

  • Script to run: /path/to/@brettz9/git-utilities/bin/open-git-url.sh

  • Parameters: --sha=$SHA $REPO/$FILE

  • Menu Caption: View File on Github (Latest on branch)

  • Script to run: /path/to/@brettz9/git-utilities/bin/open-git-url.sh

  • Parameters: $REPO/$FILE

  • Menu Caption: Directory on Github (SHA commit)

  • Script to run: /path/to/@brettz9/git-utilities/bin/open-git-url.sh

  • Parameters: --type=directory --sha=$SHA $REPO/$FILE

  • Menu Caption: Directory on Github (Latest on branch)

  • Script to run: /path/to/@brettz9/git-utilities/bin/open-git-url.sh

  • Parameters: --type=directory $REPO/$FILE

  • Menu Caption: Raw File on Github (SHA commit)

  • Script to run: /path/to/@brettz9/git-utilities/bin/open-git-url.sh

  • Parameters: --type=raw --sha=$SHA $REPO/$FILE

  • Menu Caption: Raw File on Github (Latest on branch)

  • Script to run: /path/to/@brettz9/git-utilities/bin/open-git-url.sh

  • Parameters: --type=raw $REPO/$FILE

  • Menu Caption: Blame File on Github (SHA commit)

  • Script to run: /path/to/@brettz9/git-utilities/bin/open-git-url.sh

  • Parameters: --type=blame --sha=$SHA $REPO/$FILE

  • Menu Caption: Blame File on Github (Latest on branch)

  • Script to run: /path/to/@brettz9/git-utilities/bin/open-git-url.sh

  • Parameters: --type=blame $REPO/$FILE

  • Menu Caption: History File on Github (SHA commit)

  • Script to run: /path/to/@brettz9/git-utilities/bin/open-git-url.sh

  • Parameters: --type=history --sha=$SHA $REPO/$FILE

  • Menu Caption: History File on Github (Latest on branch)

  • Script to run: /path/to/@brettz9/git-utilities/bin/open-git-url.sh

  • Parameters: --type=history $REPO/$FILE

  • Menu Caption: Commit on Github (SHA commit, Unified diff)

  • Script to run: /path/to/@brettz9/git-utilities/bin/open-git-url.sh

  • Parameters: --type=commit --diff=unified --sha=$SHA $REPO/$FILE

  • Menu Caption: Commit on Github (Latest on branch, Unified diff)

  • Script to run: /path/to/@brettz9/git-utilities/bin/open-git-url.sh

  • Parameters: --type=commit --diff=unified $REPO/$FILE

  • Menu Caption: Commit on Github (SHA commit, Split diff)

  • Script to run: /path/to/@brettz9/git-utilities/bin/open-git-url.sh

  • Parameters: --type=commit --diff=split --sha=$SHA $REPO/$FILE

  • Menu Caption: Commit on Github (Latest on branch, Split diff)

  • Script to run: /path/to/@brettz9/git-utilities/bin/open-git-url.sh

  • Parameters: --type=commit --diff=split $REPO/$FILE

  • Menu Caption: Edit File on Github

  • Script to run: /path/to/@brettz9/git-utilities/bin/open-git-url.sh

  • Parameters: --type=edit $REPO/$FILE

  • Menu Caption: Delete File on Github

  • Script to run: /path/to/@brettz9/git-utilities/bin/open-git-url.sh

  • Parameters: --type=delete $REPO/$FILE

You can also add --branch=<branch> within the parameters to target a specific branch.

(Note: to allow you to use your system path instead of hard-coding the paths above, you'd apparently need to follow one of the solutions at https://community.atlassian.com/t5/Bitbucket-questions/SourceTree-Hook-failing-because-paths-don-t-seem-to-be-set/qaq-p/274792 which create a wrapper application for Sourcetree that adds in path awareness.)

But the shell script at least will work without these solutions, as it has the line source ~/.bash_profile.

Command line usage

  • open-git-url - You can run this by either a global npm install or within a requiring project's package.json.

Run -h to get the commands:

doc-includes/cli.svg

To-dos

  1. Add to tests and coverage
  2. Allow passing in cwd (or defaulting to process.cwd()).
  3. Refactor to make export which just returns the URL that would be used
  4. Document with some CLI examples
  5. Add various commit types and use in Sourcetree scripts
  6. Script to rebase all branches at a certain depth from a given commit (default 1?)
    1. Use dialog-node (already in use for errors) to get further info for commit from user (e.g., branches to rebase onto master or a specific commit by SHA)
  7. See webappfind (AtYourCommand) for ideas of integration into Atom
  8. See https://github.com/tjunnone/npm-check-updates/issues/570; might split up so as to also be able to query npm view . repository (or npm view <npm-pkg-name> repository) and use that as a base to check (via HEAD or API requests the presence of CHANGES files, releases (with text) licenses, etc.) and also to use npm packages for opening their Github commit history, etc. URLs.
    1. Allow likes of ncu to choose a package by number, then querying it (with an option to query old version?), e.g., to get CHANGES, /commits URL, main /tree URL, etc. (Would be like --interactive but showing all by default and allowing actions after all listed, including, but not limited to, opportunity to update all.)
  9. Ensure working with global install (useful to be able to use on CL to open a Git URL from within the directory of a repo)
  10. Change to work with any Git site (allowing templates for URL building)
  11. Rename repo to reflect focus on opening? (using "git" and/or "npm" in name if adding npm support)