spdxlib 1.0.0 copy "spdxlib: ^1.0.0" to clipboard
spdxlib: ^1.0.0 copied to clipboard

Provides up-to-date SPDX licenses information and utilities in Dart.

SPDX lib #

Provides an up-to-date full list of all SPDX licenses as seen in the SPDX Licenses list, in Dart.

Usage #

import 'package:spdxlib/spdxlib.dart';

void main() {
  // Simple access for specific SPDX license by its identifier:
  SpdxLicense.$MIT;

  // Easily evaluate the standard identifier for a specific SPDX license:
  SpdxLicense.$MIT.identifier; // Output: MIT
  SpdxLicense.$BSD_2_Clause.identifier; // Output: BSD-2-Clause

  // Parse a string to get the corresponding SPDX license:
  SpdxLicense.parse('MIT'); // Output: SpdxLicense.$MIT
  SpdxLicense.tryParse('not-MIT'); // Output: null

  // Access the entire list of all SPDX licenses:
  for (final license in SpdxLicense.values) {
    if (license == SpdxLicense.$MIT) {
      // Found the MIT license!
    }
  }
}

0
likes
160
points
26
downloads

Publisher

verified publisheralestiago.com

Weekly Downloads

Provides up-to-date SPDX licenses information and utilities in Dart.

Repository (GitHub)
View/report issues
Contributing

Topics

#license #checker #compliance #audit #spdx

Documentation

API reference

License

MIT (license)

More

Packages that depend on spdxlib