
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
spdx-satisfies
Advanced tools
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.
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
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.
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.
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.
satisfies(SPDX license expression, array of approved licenses)
Approved licenses may be simple license identifiers like MIT
, plus-ranges like EPL-2.0+
, or licenses with exceptions like Apache-2.0 WITH LLVM
. They may not be compound expressions using AND
or OR
.
var assert = require('assert')
var satisfies = require('spdx-satisfies')
assert(satisfies('MIT', ['MIT', 'ISC', 'BSD-2-Clause', 'Apache-2.0']))
assert(satisfies('GPL-2.0 OR MIT', ['MIT']))
assert(!satisfies('GPL-2.0 AND MIT', ['MIT']))
assert(satisfies('GPL-3.0', ['GPL-2.0+']))
assert(!satisfies('GPL-1.0', ['GPL-2.0+']))
FAQs
test whether SPDX expressions satisfy licensing criteria
The npm package spdx-satisfies receives a total of 879,186 weekly downloads. As such, spdx-satisfies popularity was classified as popular.
We found that spdx-satisfies demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.