How to find the git hash for an npm release?

by tressie.damore , in category: Third Party Scripts , a month ago

How to find the git hash for an npm release?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by aubrey , 24 days ago

@tressie.damore 

To find the git hash for a specific npm release, you can follow these steps:

  1. Go to the npm website (https://www.npmjs.com/) and search for the package that you are interested in.
  2. Once you have found the package, look for the "Versions" tab on the package page. This tab will display a list of all published versions of the package.
  3. Click on the specific version that you are interested in to view the details of that release.
  4. Look for the "Repository" section in the release details. This section typically includes a link to the GitHub repository for the package.
  5. Open the GitHub repository in a new tab and navigate to the commit history for the repository.
  6. Look for the commit corresponding to the release version that you are interested in. The commit hash, also known as the git hash, will be displayed next to the commit message.
  7. Copy the git hash for the release version that you are interested in.


Alternatively, you can use the npm CLI to find the git hash for a specific release by running the following command:

1
npm view <package-name>@<version> gitHead


Replace <package-name> with the name of the package and <version> with the version number that you are interested in. This command will output the git hash for the specified npm release.