PRchive: A little tool for collecting media from your GitHub pull requests

Doug Avery, Former Senior Developer

Article Category: #Code

Posted on

On the front-end development team at Viget, we do a lot of our communication through GitHub’s pull requests, which allow everyone on the team to review changesets before they go into master. Since front-end devs primarily build UIs, a lot of our work is visual, so we explain our PRs with screenshots and LICEcap gifs to give reviewers more context about the changes they're critiquing.

We recently realized that these screenshots and gifs were probably valuable outside the team — we can send them to clients as minor progress updates, run them past designers to verify decisions, or archive them for our work page post-project. However, going back through our PRs and scraping out all the files is tedious work, so I decided to make something that simplified it.


PRchive is an npm module that you can point at a GitHub repo to download all the linked media from pull request bodies. It doesn’t have any options — you just run prchive, enter your GitHub creds, provide the path to repo, and it goes to work.



After it parses your pull requests, it’ll create a directory like this:



This directory contains the downloaded media and some helpful docs (a list of URLs, a page of image/embed tags, etc). At the moment, it’s pretty basic: if your URL looks like it points to a file, PRchive will download it, and if it points to a link, PRchive will find the associated file and fetch it for you. Try it out and see what it pulls from your project! If you have any questions or ideas, let me know in the comments.

Related Articles