https://github.com/jfrog/nuget-deps-tree
This npm package reads the NuGet dependencies of a .NET project, and generates a dependencies tree object.
https://github.com/jfrog/nuget-deps-tree
devops devsecops dotnet jfrog jfrog-vscode-extension jfrog-xray nuget
Last synced: 10 days ago
JSON representation
This npm package reads the NuGet dependencies of a .NET project, and generates a dependencies tree object.
- Host: GitHub
- URL: https://github.com/jfrog/nuget-deps-tree
- Owner: jfrog
- License: apache-2.0
- Created: 2020-08-31T08:03:32.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-08-02T19:15:00.000Z (9 months ago)
- Last Synced: 2025-03-11T10:50:41.577Z (about 2 months ago)
- Topics: devops, devsecops, dotnet, jfrog, jfrog-vscode-extension, jfrog-xray, nuget
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/nuget-deps-tree
- Size: 1.59 MB
- Stars: 18
- Watchers: 10
- Forks: 8
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/jfrog/nuget-deps-tree/actions/workflows/test.yml)
# 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](https://marketplace.visualstudio.com/items?itemName=JFrog.jfrog-vscode-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]`, it will print dependencies in json.or
`nuget-deps-tree --text [path to sln file]`, it will print dependencies in plain text as below:

### Project Dependency
```ts
import { NugetDepsTree } from 'nuget-deps-tree';
let tree = NugetDepsTree.generate(pathToSlnFile);
```## Tree Structure
```json
{
"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 10 or above
* Node 18 or aboveTo 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.