0

How to find the older versions of source code for a node package on github?

For example, I want to check the source code of material@5.0.1. When I go on to https://www.npmjs.com/package/@mui/icons-material/v/5.0.1, and click on the repository link https://github.com/mui/material-ui, we land on the repo for the latest version 5.5.1. But, I want to go back to the older versions of the source code.

Appreciate any help here.

texpert
  • 185
  • 1
  • 3
  • 14
  • click on the branch button (says `Master` by default) it opens on the `branch` tab, but you can click on the `tags` tab and scroll down to the version you want. – pilchard Apr 01 '22 at 19:01
  • If you're cloning it to local see: [Download a specific tag with Git](https://stackoverflow.com/questions/791959/download-a-specific-tag-with-git) – pilchard Apr 01 '22 at 19:03

1 Answers1

0

Following what pilchard said as a comment, you can click the commit on each of the tags in the tags tab. For example, it looks like the commit for v5.0.1 is here: https://github.com/mui/material-ui/tree/afcf3ee18e7a9c526348b3bce74b69781b4ad071

Bradley B
  • 63
  • 1
  • 8
  • 1
    A clearer url is https://github.com/mui/material-ui/tree/v5.0.1 – pilchard Apr 01 '22 at 19:05
  • 2
    A small precision: The code on GitHub might not be the actual code of the package version. In this case, it is a serious project so it should match. But NPM does not provide a way to check the code and there is no guarantee its matches the GitHub tag. Or even that there is a Git repository for the dependency. –  Apr 01 '22 at 19:41
  • 1
    Another way to be able to check the code of a dependency for which there is no GitHub repository or for which we don't fully trust would be installing it and looking at the code in the "node_modules/". Or using tools like https://socket.dev/ that do that and let us explore the dependency files. –  Apr 01 '22 at 19:42