Git Product home page Git Product logo

dependency-deprecated-checker's Introduction

Dependency Deprecation Checker

Description

This program is a Dependency Deprecation Checker that helps to identify deprecated dependencies in your Node.js project by analyzing the package.json file. It checks both direct and indirect dependencies against several criteria:

  • if they are marked as deprecated on npm
  • if their repository on GitHub is archived
  • if the GitHub repository provided is not accessible (returns 404)
  • if they do not have repository information.

The criteria for a deprecated package can be modified by the users.

This tool is a Proof of Concept (PoC) and does not offer a comprehensive check.

What lead to the creation of this tool

We found that 8.2% percent of the most downloaded npm packages are officially deprecated, but due to inconsistent practices in handling package dependencies, the real number is much larger, closer to 21.2%.

Moreover, some package maintainers, when confronted with security flaws, deprecate their packages instead of reporting them, getting a CVE assigned or remediating the vulnerabilities. These gaps can leave developers unaware that they are using unmaintained, vulnerable packages, and create opportunities for attackers to take over unmaintained code that continues to be used.

funnel (2)

More information can be found on our blog.

Installation

Before you begin, ensure you have Python installed on your system. Then, clone the repository and install the dependencies:

git clone https://github.com/Aqua-Nautilus/Dependency-Deprecated-Checker.git
cd Dependency-Deprecated-Checker
pip install -r requirements.txt

Usage

To use the Dependency Deprecation Checker, you will need a GitHub token (without permissions).

python scan_dependencies.py --github_token YOUR_GITHUB_TOKEN [--exclude-archived] [--exclude-repo] [--exclude-inaccessible] [package_json_file]

Command-line Arguments

  • package_json_file: Path to package.json file. Defaults to 'package.json' in the current directory.
  • --github-token: GitHub token for API access. This is mandatory unless --exclude-archived and --exclude-inaccessible are used.
  • --exclude-archived: Exclude alerting on packages linked to archived repositories in GitHub.
  • --exclude-repo: Exclude alerting on packages without an associated repository.
  • --exclude-inaccessible: Exclude alerting on packages with a GitHub repository that is not accessible (404).

An example of the results on the sample package.json:

final_example

dependency-deprecated-checker's People

Contributors

ilaygoldman avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.