New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

hasdep

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hasdep

Check for a dependency (and version) across a Github Org or specific repo

  • 1.3.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

#hasdep

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 Github.com 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:

export GHACCESS_TOKEN=XXXXXXXXXXXXXXXXXXXXX where XXXXXXXXXXXXXXXXXX is the token you just copied.

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

##Installation

npm install hasdep -g

##Setup

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 Github.com, 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 https://github02.acme-anvils.com you would set:

host: "github02.acme-anvils.com",

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.

##Usage

###Options

-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)

###Examples

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

##Help

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.

FAQs

Package last updated on 20 Sep 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc