{
  "name": "validate-npm-package-license",
  "description": "Give me a string and I'll tell you if it's a valid npm package license string",
  "version": "3.0.1",
  "author": {
    "name": "Kyle E. Mitchell",
    "email": "kyle@kemitchell.com",
    "url": "https://kemitchell.com"
  },
  "dependencies": {
    "spdx-correct": "~1.0.0",
    "spdx-expression-parse": "~1.0.0"
  },
  "devDependencies": {
    "defence-cli": "^1.0.1",
    "replace-require-self": "^1.0.0"
  },
  "keywords": [
    "license",
    "npm",
    "package",
    "validation"
  ],
  "license": "Apache-2.0",
  "repository": {
    "type": "git",
    "url": "kemitchell/validate-npm-package-license.js"
  },
  "scripts": {
    "test": "defence README.md | replace-require-self | node"
  },
  "readme": "validate-npm-package-license\n============================\n\nGive me a string and I'll tell you if it's a valid npm package license string.\n\n```javascript\nvar valid = require('validate-npm-package-license');\n```\n\nSPDX license identifiers are valid license strings:\n\n```javascript\n\nvar assert = require('assert');\nvar validSPDXExpression = {\n  validForNewPackages: true,\n  validForOldPackages: true,\n  spdx: true\n};\n\nassert.deepEqual(valid('MIT'), validSPDXExpression);\nassert.deepEqual(valid('BSD-2-Clause'), validSPDXExpression);\nassert.deepEqual(valid('Apache-2.0'), validSPDXExpression);\nassert.deepEqual(valid('ISC'), validSPDXExpression);\n```\nThe function will return a warning and suggestion for nearly-correct license identifiers:\n\n```javascript\nassert.deepEqual(\n  valid('Apache 2.0'),\n  {\n    validForOldPackages: false,\n    validForNewPackages: false,\n    warnings: [\n      'license should be ' +\n      'a valid SPDX license expression (without \"LicenseRef\"), ' +\n      '\"UNLICENSED\", or ' +\n      '\"SEE LICENSE IN <filename>\"',\n      'license is similar to the valid expression \"Apache-2.0\"'\n    ]\n  }\n);\n```\n\nSPDX expressions are valid, too ...\n\n```javascript\n// Simple SPDX license expression for dual licensing\nassert.deepEqual(\n  valid('(GPL-3.0 OR BSD-2-Clause)'),\n  validSPDXExpression\n);\n```\n\n... except if they contain `LicenseRef`:\n\n```javascript\nvar warningAboutLicenseRef = {\n  validForOldPackages: false,\n  validForNewPackages: false,\n  spdx: true,\n  warnings: [\n    'license should be ' +\n    'a valid SPDX license expression (without \"LicenseRef\"), ' +\n    '\"UNLICENSED\", or ' +\n    '\"SEE LICENSE IN <filename>\"',\n  ]\n};\n\nassert.deepEqual(\n  valid('LicenseRef-Made-Up'),\n  warningAboutLicenseRef\n);\n\nassert.deepEqual(\n  valid('(MIT OR LicenseRef-Made-Up)'),\n  warningAboutLicenseRef\n);\n```\n\nIf you can't describe your licensing terms with standardized SPDX identifiers, put the terms in a file in the package and point users there:\n\n```javascript\nassert.deepEqual(\n  valid('SEE LICENSE IN LICENSE.txt'),\n  {\n    validForNewPackages: true,\n    validForOldPackages: true,\n    inFile: 'LICENSE.txt'\n  }\n);\n\nassert.deepEqual(\n  valid('SEE LICENSE IN license.md'),\n  {\n    validForNewPackages: true,\n    validForOldPackages: true,\n    inFile: 'license.md'\n  }\n);\n```\n\nIf there aren't any licensing terms, use `UNLICENSED`:\n\n```javascript\nvar unlicensed = {\n  validForNewPackages: true,\n  validForOldPackages: true,\n  unlicensed: true\n};\nassert.deepEqual(valid('UNLICENSED'), unlicensed);\nassert.deepEqual(valid('UNLICENCED'), unlicensed);\n```\n",
  "readmeFilename": "README.md",
  "_id": "validate-npm-package-license@3.0.1",
  "dist": {
    "shasum": "ca7e03f9d4a281ad24f2de992284d5a9115eeb93"
  },
  "_from": "validate-npm-package-license@^3.0.1",
  "_resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz"
}
