What is spdx-satisfies?
The spdx-satisfies npm package is used to determine if a given SPDX license expression satisfies another SPDX license expression. This is particularly useful for license compliance checks in software projects.
What are spdx-satisfies's main functionalities?
Check if a license satisfies another license
This feature allows you to check if one license satisfies another license. In this example, the MIT license satisfies the 'MIT OR Apache-2.0' license expression.
const spdxSatisfies = require('spdx-satisfies');
const license1 = 'MIT';
const license2 = 'MIT OR Apache-2.0';
const result = spdxSatisfies(license1, license2);
console.log(result); // true
Check if a complex license expression satisfies another
This feature allows you to check if a complex license expression satisfies another complex license expression. In this example, the '(MIT AND Apache-2.0)' license expression satisfies the '(MIT AND Apache-2.0) OR GPL-3.0' license expression.
const spdxSatisfies = require('spdx-satisfies');
const license1 = '(MIT AND Apache-2.0)';
const license2 = '(MIT AND Apache-2.0) OR GPL-3.0';
const result = spdxSatisfies(license1, license2);
console.log(result); // true
Other packages similar to spdx-satisfies
spdx-expression-validate
The spdx-expression-validate package is used to validate SPDX license expressions. While it does not check if one license satisfies another, it ensures that the license expressions are valid according to the SPDX specification.
spdx-correct
The spdx-correct package is used to correct common mistakes in SPDX license expressions. It helps in ensuring that the license expressions are correctly formatted but does not provide functionality to check if one license satisfies another.
spdx-license-ids
The spdx-license-ids package provides a list of all valid SPDX license identifiers. It is useful for validating and listing license identifiers but does not offer the functionality to check if one license satisfies another.