Socket
Socket
Sign inDemoInstall

spdx-correct

Package Overview
Dependencies
3
Maintainers
2
Versions
18
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

spdx-correct

correct invalid SPDX expressions


Version published
Maintainers
2
Weekly downloads
24,354,581
increased by4.75%
Bundle size
5.1 kB
Minified + gzipped

Weekly downloads

Package description

What is spdx-correct?

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.

What are spdx-correct's main functionalities?

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'

Other packages similar to spdx-correct

Readme

Source

Usage

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')

Contributors

spdx-correct has benefited from the work of several contributors. See the GitHub repository for more information.

Keywords

FAQs

Last updated on 07 Mar 2023

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc