Skip to content

Main content

Package JSON License SPDX Prefix Tool

Compute package json license spdx prefix from explicit bounded inputs.

Loading tool…

Description

Inspect a package license value for an external license-file phrase.

License-related tokens can point to a file or express a legacy suffix convention. Lexical recognition does not establish that a license exists, applies to the content or permits a proposed reuse.

Inspect a package license value for an external license-file phrase.

When to use this tool

Use Package JSON License SPDX Prefix when checking a restricted license-metadata spelling.

How to use the tool and how it works

  1. Enter value. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read external, file. Inspect external before interpreting the associated values.

Inspect a package license value for an external license-file phrase. Require nonempty value; exact SEE LICENSE IN prefix plus nonempty file text sets external and returns file, otherwise file is empty.1

Package metadata can direct readers to a license file; recognizing that pointer does not establish its contents or applicable rights.2

Input fieldMeaning and unitsAccepted input
valueValueRequired. Text; maximum UTF-16 length 8192.
Output fieldInterpretationReturned shape
externalExternalRequired. Boolean.
fileFileRequired. Text; maximum UTF-16 length 8192.
json
{
  "input": {
    "value": "SEE LICENSE IN LICENSE.txt"
  },
  "output": {
    "external": true,
    "file": "LICENSE.txt"
  }
}

Limitations and assumptions

  • It does not validate SPDX expressions, resolve the file or establish reuse rights.
  • Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.

Alternative or Complementary methods

Read the actual license and relevant provenance; use a proper SPDX parser for expressions and appropriate advice for legal interpretation.

References

  1. Calculation and input contract: development/package-json-license-spdx-prefix — tool.io

  2. package.json: license — npm

Similar or alternative tools