
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
spdx-correct
Advanced tools
The spdx-correct npm package is used to correct invalid SPDX license identifiers to valid ones. SPDX (Software Package Data Exchange) is a standard format for communicating the licensing information of software packages. The spdx-correct package takes a possibly incorrect SPDX expression and returns a corrected version that is valid according to the SPDX specification, if possible.
Correcting invalid SPDX license identifiers
This feature takes an invalid SPDX license identifier, such as 'Apache 2.0', and corrects it to a valid identifier, 'Apache-2.0'.
"use strict";
const spdxCorrect = require('spdx-correct');
const corrected = spdxCorrect('Apache 2.0');
console.log(corrected); // 'Apache-2.0'
This package parses valid SPDX license expressions, ensuring they conform to the SPDX specification. Unlike spdx-correct, it does not correct invalid expressions but rather parses and validates the structure of valid SPDX expressions.
This package provides a list of SPDX license identifiers. It can be used to validate if a given license identifier is a valid SPDX identifier. It does not correct invalid identifiers but can be used to check validity against the list of known identifiers.
This package checks if a given license string is a valid npm package license string, which can be an SPDX license expression. It is similar to spdx-correct in that it deals with license validation, but it does not correct invalid identifiers.
var correct = require('spdx-correct')
var assert = require('assert')
assert.strictEqual(correct('mit'), 'MIT')
assert.strictEqual(correct('Apache 2'), 'Apache-2.0')
assert(correct('No idea what license') === null)
// disable upgrade option
assert(correct('GPL-3.0'), 'GPL-3.0-or-later')
assert(correct('GPL-3.0', { upgrade: false }), 'GPL-3.0')
spdx-correct has benefited from the work of several contributors. See the GitHub repository for more information.
FAQs
correct invalid SPDX expressions
We found that spdx-correct demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.