Check a repo or all repos in an org for a dependency (optionally including version)
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Check for a specified dependency across all repositories in a Github Organization or a specific repository.

Requires a GH Access Token set as an environment variable.

First, if you don't already have a token, create one by going to or your private Github instance, clicking on your avatar in the top right and choosing "Settings", then choosing "Personal Access Tokens" from the menu on the left, and hit "Generate New Token". Name it "hasdep" and copy it.

Then add to your ~/.bash_profile or ~/.bashrc or wherever you do this kind of thing on your machine:


Save it and source your bash file before trying to continue.


npm install hasdep -g


Copy the supplied config.default.json to ~/hasdep-config.json. This file will be used whenever a local hasdep-config.json is not present. If you wish to perform a search with different settings, run hasdep from a directory which contains a hasdep-config.json with those settings.

cp config-public.default.json ~/hasdep-config.json

If you're searching, you're good to proceed.

If you're searching an internal github instance, use config-internal.default.json and change host to the correct domain. E.g. if your Github instance is at you would set:

host: "",

in hasdep-config.json.

You probably don't want to accidentally commit that value to a public repo, which is why hasdep-config.json is in .gitignore. Information Leakage is a genuine security threat, folks.



-o Organization (or User) to search in
-r Repository to search in
-d Dependency to look for (name that appears in the module's package.json name field)
-v Specific Version to check for (will check based on npm SemVer comparison)
-n Negative search. Valid values: "any" (search dependencies and devDependencies), "full" (search only dependencies), "dev" (search only devDependencies)


Check for react in all repositories in Organization acme

hasdep -o acme -d react

Check if repository anvil in Organization acme has dependency roadrunner

hasdep -o acme -r anvil -d roadrunner

Check for hapi@11.0.0 in all repositories in Organization acme

hasdep -o acme -d hapi -v 11.0.0


If it's not doing what you think it should be doing, or what you wish it did, file an issue on this repository with as much detail concerning what you did, and what happened, as you can possibly spare.