pubguardian 0.1.9 copy "pubguardian: ^0.1.9" to clipboard
pubguardian: ^0.1.9 copied to clipboard

Supply-chain security scanner for Dart and Flutter — CVE, license, and abandoned-package checks with SARIF and CycloneDX output.

example/pubguardian_example.dart

/// Example: using pubguardian as a library to scan a project's dependencies.
library;

import 'package:pubguardian/pubguardian.dart';

void main() async {
  final runner = Runner();

  try {
    final result = await runner.run(
      const ScanConfig(
        minSeverity: Severity.high,
        licensePolicy: LicensePolicy.commercial,
      ),
      onStatus: print,
    );

    final report = result.report;
    print('\n--- Scan complete ---');
    print('${report.totalVulnerabilities} CVEs across '
        '${report.totalPackages} packages');

    if (result.licenseFindings.isNotEmpty) {
      print('\nLicense violations:');
      for (final f in result.licenseFindings) {
        print('  ${f.packageName}: ${f.license.spdxId}');
      }
    }

    if (result.healthFindings.isNotEmpty) {
      print('\nHealth issues:');
      for (final f in result.healthFindings) {
        print('  ${f.packageName}: ${f.message}');
      }
    }
  } finally {
    runner.close();
  }
}
3
likes
160
points
278
downloads

Documentation

API reference

Publisher

verified publishersonofnos.com

Weekly Downloads

Supply-chain security scanner for Dart and Flutter — CVE, license, and abandoned-package checks with SARIF and CycloneDX output.

Repository (GitHub)
View/report issues

Topics

#security #cve #sbom #supply-chain #cli

License

Apache-2.0 (license)

Dependencies

args, http, yaml

More

Packages that depend on pubguardian