Package Probe 🛰
Scan a Github organization for usage of a package.
Package Probe can help you answer questions such as "Which repositories in my organization are using React?" or "Which version of internal dependency X are my organization's projects using?"
Installation
$ npm install -g package-probe
Set up (one time)
Package Probe uses the Github API to scan for a package. If you want to search in a private Github organization, you'll need to create a Github Personal Access Token that has access to your organization and set it as an environment variable when running package-probe
.
If you are scanning public organizations/owners, you can skip this step.
- Generate a Github Personal access token in your Github profile developer settings
- Grant the
repo
scope to the token (Package Probe reads information and does not store any of your data) - Add it to your environment as
GITHUB_TOKEN
orGH_TOKEN
. (e.g.export GITHUB_TOKEN=<your token>
)
Command line usage
$ package-probe --help Usage: package-probe [options] Options: --json output results as json --owner <owner> Github owner/organization to scan --partial-matches return results
Package probe will automatically use a Github Personal Access Token defined in the GITHUB_TOKEN
or GH_TOKEN
environment variable.
Advanced usage
While the CLI provides quick use, you have more control through the advanced options available in the JavaScript interface.
JavaScript API
probe(options)
// options // See Github REST API documentation (https://developer.github.com/v3/repos/#get) for available fields
Recipes
Scan for an private package
console.logresults
Exclude archived repositories
Add the last commit and description to the output
Example CLI search results
Searching my Github repositories for usage of React.
$ package-probe --search-term react --owner ryanoglesby08🛰️ Scanning...✨ Found 15 matches!┌──────────────────────────────────┬──────────────────────────────────┬─────────────────┐│ Repository name │ Package/app name │ Version │├──────────────────────────────────┼──────────────────────────────────┼─────────────────┤│ the-eod-machine │ @the-eod-machine/ui │ ^16.4.1 │├──────────────────────────────────┼──────────────────────────────────┼─────────────────┤│ movie-night │ movie-night │ ^16.7.0-alpha.2 │├──────────────────────────────────┼──────────────────────────────────┼─────────────────┤│ email-autocomplete │ email-autocomplete │ ^16.5.2 │├──────────────────────────────────┼──────────────────────────────────┼─────────────────┤│ exposing-css-hidden-complexities │ exposing-css-hidden-complexities │ ^16.1.1 │├──────────────────────────────────┼──────────────────────────────────┼─────────────────┤│ splitit │ splitit │ ^15.3.2 │├──────────────────────────────────┼──────────────────────────────────┼─────────────────┤│ react-dashboard │ react-bare-app │ ^15.5.4 │├──────────────────────────────────┼──────────────────────────────────┼─────────────────┤│ react-quizzer │ react-quizzer │ ^15.1.0 │├──────────────────────────────────┼──────────────────────────────────┼─────────────────┤│ ssr-media-queries │ ssr-media-queries │ ^16.2.0 │├──────────────────────────────────┼──────────────────────────────────┼─────────────────┤│ javascript-workshop │ react-workshop-webpack │ ^15.4.1 │├──────────────────────────────────┼──────────────────────────────────┼─────────────────┤│ react-bare-app │ react-bare-app │ ^15.5.4 │├──────────────────────────────────┼──────────────────────────────────┼─────────────────┤│ javascript-workshop │ react-workshop-real-server │ ^15.4.1 │├──────────────────────────────────┼──────────────────────────────────┼─────────────────┤│ javascript-workshop │ react-workshop-real-server │ ^15.4.1 │├──────────────────────────────────┼──────────────────────────────────┼─────────────────┤│ the-eod-machine │ @the-eod-machine/emailer │ ^16.4.2 │├──────────────────────────────────┼──────────────────────────────────┼─────────────────┤│ javascript-workshop │ react-workshop-real-server │ ^15.4.1 │├──────────────────────────────────┼──────────────────────────────────┼─────────────────┤│ css-playground │ js-hide-instead-of-by-class │ ^15.4.2 │└──────────────────────────────────┴──────────────────────────────────┴─────────────────┘