7.0.0 • Published 2 years ago

dependency-check-update v7.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

Open in Visual Studio Code

About The Project

Applications written in Node.js have multiple dependencies and making sure that these dependencies are up to date can be a bit of a hassle. dependency-check-update is a CLI tool which helps in comparing the versions of a given package in given github repositories against a given version and returning whether the versions are satisfied or not. If not satisfied, the tool can also create Pull Requests updating the versions to the given version. Additional Feature: An option to update the versions of the given package to the latest version available in npm resgistry is also provided. The names and links to the input github repositories are given to the tool in the form of a csv file. A sample csv file named "data.csv" with test data can be found in the root of this repository.

Built With

Getting Started

To install the tool, run the following command:

npm install -g dependency-check-update

//insert image

Usage

IMPORTANT: Make sure the CSV file is present in the current working directory of the terminal. If not, cd into the folder where the file is present. A sample CSV file named data.csv is given in this repo for testing purposes.

The examples shown in this section were run a AWS EC2 machine with Ubuntu (Linux).

The CLI tool has the following 3 features: 1. Check versions: Given a list of Github repositories in the form of a csv file (the csv file should have 2 columns: name and repo), such that all of them are node js projects with a package.json and package-lock.json in the root, and the name and version of a dependency, the tool gives the current version of that dependency and tells if the version is greater than or equal to the version specified or not. 2. Update versions: For all the repositories that have the version lower than the one specified, if passed as additional param, -update, it will create a Pull Request updating the version.
3. Update versions to the latest one (additional feature): Updates the versions of the specified package to the latest version available in npm resgistry by creating PRs.

Let's look at examples of each of these features:

  1. Check versions:

Syntax:

dependency-check-update -i <CsvFileName> <PackageName@InputVersion>

Example:

dependency-check-update -i data.csv axios@0.23.0

//insert image

  1. Update versions:

Syntax:

dependency-check-update -update -i <CsvFileName> <PackageName@InputVersion>

Example:

dependency-check-update -update -i data.csv axios@0.23.0

//insert image

  1. Update versions to the latest one (additional feature):

Syntax:

dependency-check-update -updatelatest -i <CsvFileName> <PackageName>

Example:

dependency-check-update -updatelatest -i data.csv axios

//insert image

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

License

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

Contact

Tanish Malekar - LinkedIn - tanishmalekar32@gmail.com

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

Acknowledgments

I would like to thank Dyte for providing this oppurtunity to create a CLI tool as a part of their hiring challenge. I learnt a lot in the process.