microsoft / OSSGadget

Collection of tools for analyzing open source packages.
MIT License
315 stars 49 forks source link

Feature Request: Retrieve download link for package #466

Open iskaleade opened 6 months ago

iskaleade commented 6 months ago

It would be great if there was a way to not just download e.g. .tgz from NPM for a given package name & version but to also ouput the URL the package was downloaded from (for future reference / easy sharing etc.). I searched through the functions of OSSGadget already provided and could not find it (to stay with the NPM example: I do not mean the URL of the NPM page but the URL for the download - not GitHub, but the actual package).

Example: say I want to download the NPM package @fullstory/browser, Version 2.0.3. I can download the package using OSS-download. But if I want to share the location of the file I would have to figure out how the URL to https://registry.npmjs.org/ is structured, how they named the download etc.

Pretty sure the information is already there (?) (to perform the download) but it would be nice if it was also output for convenience.

Thanks!

gfs commented 6 months ago

Hi, thanks for the suggestion. I bet this is something we could include in the console output if that would meet your need.

iskaleade commented 5 months ago

That would be amazing and a great help! Thank you!

gfs commented 5 months ago

I looked into this a bit more, it looks like there is already a trace logging statement in the api that fetches the uri: https://github.com/microsoft/OSSGadget/blob/4a24249b20aff700db0cad68a4ed22496453b47b/src/Shared/PackageManagers/BaseProjectManager.cs#L111, but it doesn't look like there is a command line parameter to enable trace logging. I think you should be able to enable it via an Nlog config file, but it seems like it would be nice to also have available as a command line switch.