nuget-deps-tree
TypeScript icon, indicating that this package has built-in type declarations

0.3.1 • Public • Published

Test

NuGet Dependency Tree

This npm package reads the NuGet dependencies of a .NET project, and generates a dependency tree. This package was developed by JFrog, and is used by the JFrog VS-Code Extension to generate the dependency tree for projects using NuGet dependencies. You may use this package for other purposes and applications as well, either by running via command line or by importing to your project.

Installation

npm install -g nuget-deps-tree

Usage

Prerequisites

nuget (or nuget.exe) should be available in $PATH.

Command Line

nuget-deps-tree [path to sln file]

Project Dependency

import { NugetDepsTree } from 'nuget-deps-tree';
let tree = NugetDepsTree.generate(pathToSlnFile);

Tree Structure

{
  "projects": [
    {
      "name": "First.Project",
      "dependencies": [
        {
          "id": "dependency.One",
          "version": "1.0.0",
          "dependencies": [
            {
              "id": "dependency.Child",
              "version": "4.0.0",
              "dependencies": []
            }
          ]
        },
        {
          "id": "dependency.Two",
          "version": "2.0.0",
          "dependencies": []
        }
      ]
    },
    {
      "name": "Second.Project",
      "dependencies": [
        {
          "id": "dependency.Three",
          "version": "3.0.0",
          "dependencies": []
        }
      ]
    }
  ]
}

Building and Testing the Sources

Preconditions

  • npm 7 and above

To build the plugin sources, please follow these steps:

  • Clone the code from git.
  • Install and pack the nuget-deps-tree dependency locally, by running the following npm commands:
npm i && npm pack

If you'd like run the nuget-deps-tree tests, run the following command:

npm t

Pull requests

We welcome pull requests from the community.

Guidelines

  • If the existing tests do not already cover your changes, please add tests.
  • Please run npm run format for formatting the code before submitting the pull request.

Package Sidebar

Install

npm i nuget-deps-tree

Weekly Downloads

167

Version

0.3.1

License

Apache-2.0

Unpacked Size

116 kB

Total Files

60

Last publish

Collaborators

  • jfrog