Skip to main content

CLI Tools to check dependencies of a node project github repository

Project description


Logo

NPMVALIDDEP

CLI tool made in python to check and update the npm package dependencies in github repositories
Explore the docs »

View Demo · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Contributing
  5. License
  6. Contact
  7. Acknowledgments

About The Project

NPMVALIDDEP is a cli tool made in python used to check the version of NPM packages in a github repository of NodeJs project. You can specify multiple packages to check and also specify if you want to raise a PR in case the packages are not up-to-date. It works for public as well as private repositories (provided that you are authorised to access the repository), in case you are the owner of the repository then instead of raising a PR it will directly commit to the repository main brach.

(back to top)

Built With

(back to top)

Getting Started

Below listed are the detailed steps to install the package with the prereqisites required.

Prerequisites

You need to have following things installed:

  1. Pip (Package Installer for python)
  2. Git
  3. Node and npm

Installation

Create a python virtual environment and install the npmvaliddep package using pip project_url

pip install npmvaliddep

(back to top)

Usage

In order to ensure that you can access the private repositories, you need to add your github username and authentication token (Don't worry we store your token locally and never reveal it even to you :sunglasses:)

To check your cofigured github username and password:

npmvaliddep --getgithubcreds

To configure your cofigured github username and password:

npmvaliddep --setgithubcreds

To check if the stored password matched your password:

npmvaliddep --matchgithubpass

To perform dependency check of multiple github repositories and packages:

  1. (Required) Create a csv file with the following headers and enter the rows accordingly. image

  2. (Required) Specify the path to the csv using --check flag

npmvaliddep --check '/home/user/checkrepos.csv'
  1. (Required) Specify the dependencies you need to check using the --deps flag
npmvaliddep --check '/home/user/checkrepos.csv' --deps axios@0.23.0 cookie-parser@1.4.6
  1. (Optional) By default the output csv will be generated in the user home directory but if you want to change that you can specify the path using --output flag
npmvaliddep --check '/home/user/checkrepos.csv' --deps axios@0.23.0 cookie-parser@1.4.6 --output '/home/user/Downloads/output.csv'

image

  1. (Optional) If you waant to generate a PR to update the dependencies then you can pass a --createpr flag
npmvaliddep --check '/home/user/checkrepos.csv' --deps axios@0.23.0 cookie-parser@1.4.6 --output '/home/user/Downloads/output.csv' --createpr

image Note - In the above image you can notice that the last repository belongs to me i.e. the user of the CLI, in this case the tool will not create a PR but will directly commit the changes to the main branch of the repository. Also note that if a repository is private and the user is not authorised to access it then the tool will skip that repository.

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Akshat Gupta - @linkedin_handle - Mail me

Project Link: https://github.com/dyte-submissions/dyte-vit-2022-Akshat1903

(back to top)

Acknowledgments

  • I would like to thank dyte recruitment team to give this challenging task and focusing on the other half of the students who don't only crave for DSA :wink:

(back to top)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

npmvaliddep-2.1.3.tar.gz (12.8 kB view hashes)

Uploaded Source

Built Distribution

npmvaliddep-2.1.3-py3-none-any.whl (10.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page