NuGet.CatalogReader is a library for reading the full list of package ids, versions, and the change history for NuGet v3 feeds.
NuGetMirror.exe is a tool that uses NuGet.CatalogReader to download packages from a NuGet v3 feed to a folder on disk.
AppVeyor | Travis |
---|---|
https://nuget.blob.core.windows.net/packages/index.json
This solution uses .NET Core, get the tools here.
Discover all packages in a feed using GetFlattenedEntriesAsync
. To see the complete history including edits use GetEntriesAsync
.
var feed = new Uri("https://api.nuget.org/v3/index.json");
using (var catalog = new CatalogReader(feed))
{
foreach (var entry in await catalog.GetFlattenedEntriesAsync())
{
Console.WriteLine($"[{entry.CommitTimeStamp}] {entry.Id} {entry.Version}");
}
}
Mirror all packages to a folder on disk.
NuGetMirror.exe nupkgs https://api.nuget.org/v3/index.json -o d:\tmp