/LicenseTracker

LicenseTracker is a library for tracking licenses of dependencies.

Primary LanguageC#MIT LicenseMIT

Icon

LicenseTracker

Build status license NuGet

LicenseTracker is a library for tracking licenses of dependencies.

Features:

  • License sources: GitHub and Spdx
  • License authorities: NuGet and npm
  • License URL providers: NuGet
  • License readers: GitHub
  • License comparers: Soerensen-Dice
  • Write your own license source, authority, url provider, reader and comparer

Usage:

  • Get licenses from GitHub:
	var licenseSource = new GitHubLicenseSource();
	var licenses = await licenseSource.GetLicensesAsync();
  • Get licenses from Spdx:
	var licenseSource = new SpdxLicenseSource();
	var licenses = await licenseSource.GetLicensesAsync();
  • Check license of dependency:
	var check = new LicenseCheck();

	var licenses = await licenseSource.GetLicensesAsync();
	check.AddKnownLicenses(licenses);

	check.AddLicenseAuthority(new NuGetLicenseAuthority(check.KnownLicenses));
	check.AddLicenseAuthority(new NpmLicenseAuthority(check.KnownLicenses));

	var license = await check.ExecuteAsync("Newtonsoft.Json", "11.0.1");

Thanks