JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 34275387
  • Score
    100M100P100Q228520F
  • License Apache-2.0

Give me a string and I'll tell you if it's a valid npm package license

Package Exports

  • validate-npm-package-license

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (validate-npm-package-license) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

npm-validate-package-license

Give me a string and I'll tell you if it's a valid npm package license.

This package is not endorsed or approved by npm. It is part of a proposal to add license field validation to the npm command-line interface.

var validResult = {
  validForNewPackages: true,
  validForOldPackages: true
};

valid('Apache-2.0'); // => validResult
valid('GPL-3.0 OR BSD-2-Clause'); // => validResult

var invalidResult = {
  validForOldPackages: false,
  validForNewPackages: false,
  warnings: [
    'license should be a valid SPDX license expression',
    'license is similar to the valid expression "Apache-2.0"'
  ]
};

valid('Apache 2.0'); // => invalidResult