Git Product home page Git Product logo

nuget_scanner's Introduction

NuGet Scanner

Overview

The NuGet Scanner is a powerful tool designed for C# (.NET) engineers to easily scan their projects, identify used NuGet packages & licenses, check if those packages are outdated, and generate a detailed report. This application leverages Rust's performance and safety to provide quick and reliable results.

This is the successor of the NuGet Helper that was released many years ago.

main_menu

Features

  • Scan C# Projects. Automatically detects and processes .csproj and packages.config files within the specified directory.
  • Identify NuGet Packages. Extracts the list of NuGet packages used in each project.
  • Fetch Package Details. Retrieves comprehensive information about each NuGet package from the NuGet API, including:
    • Package Name (the name of the NuGet package)
    • Current Version (the version of the package currently used in the project)
    • Latest Version (the latest available version of the package)
    • License URL (a URL pointing to the license information of the package)
    • License Type (the license type or expression associated with the package)
    • Published Date (the date when the current version of the package was published)
  • Check for Outdated Packages. Compares the current version of each package with the latest available version to identify outdated packages.
  • Generate Detailed Reports. Outputs a detailed report in markdown file for each project, listing all NuGet packages along with their details and version status.
  • Multiple Project Support. Capable of scanning directories containing multiple C# projects, ensuring each project is analyzed individually.
  • Execution Time Measurement. Measures and displays the total execution time of the scanning process.

Notes

  • The application uses the NuGet API to fetch package details. Therefore, an active internet connection is required.
  • The inner parser uses NuGet SemVer2 so not every (old) package may be parsed correctly.

Usage

Prerequisites

  • Rust. Ensure that Rust is installed on your system. You can install Rust from rust-lang.org.

Building the Project

Clone the repository and build the project using Cargo:

git clone https://github.com/RustamIrzaev/nuget_scanner.git
cd nuget_scanner
cargo build --release    # builds the project

cd target/release        # switch to where the executable is placed
./nuget-scanner -f <FOLDER> -r # run nuget-scanner! (see options below)

Running the Application

To run the application, specify the directory to scan and optionally the maximum depth for scanning:

./nuget-scanner -f /path/to/your/csharp/project -r

Parameters

  • -f or --folder: path to the directory containing the C# project(s).
  • -r or --report: to generate a report
  • --max-depth: (Optional) specifies the maximum depth for scanning directories. Default is 10.

Example output

Project: MyProject

- NuGet Package #1, version 13.0.3
  license: MIT
  license URL: https://github.com/RustamIrzaev/nuget_scanner/license.md
  description: Package description
  project URL: https://github.com/RustamIrzaev/nuget_scanner
  released at: 08 Mar 2023
- NuGet Package #2, version 12.0.3
  license: MIT
  license URL: https://github.com/RustamIrzaev/nuget_scanner/license.md
  description: Package description
  project URL: https://github.com/RustamIrzaev/nuget_scanner
  released at: 08 Mar 2024

Completed in: 0.23 seconds

Example report

Demo report can be found here.

main_menu

License

This project is licensed under the Apache License 2.0. See the LICENSE file for details.

nuget_scanner's People

Contributors

rustamirzaev avatar

Watchers

 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.