├── .editorconfig ├── .gitattributes ├── .github ├── .editorconfig └── workflows │ ├── ci.yml │ └── latest.yml ├── .gitignore ├── README.md ├── build.js ├── deprecated.json ├── index.json ├── latest.js ├── package.json └── test.js /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | indent_style = tab 7 | tab_width = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.{md,yml}] 12 | indent_style = space 13 | 14 | [*.md] 15 | trim_trailing_whitespace = false 16 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | -------------------------------------------------------------------------------- /.github/.editorconfig: -------------------------------------------------------------------------------- 1 | [*.workflow] 2 | indent_style = space 3 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Node.js CI 3 | on: [push, pull_request] 4 | jobs: 5 | test: 6 | runs-on: ubuntu-latest 7 | steps: 8 | - uses: actions/checkout@v4 9 | - uses: actions/setup-node@v4 10 | - run: npm test 11 | -------------------------------------------------------------------------------- /.github/workflows/latest.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: 'Check Latest SPDX License List' 3 | on: 4 | workflow_dispatch: 5 | inputs: {} 6 | schedule: 7 | - cron: '0 0 */7 * *' 8 | jobs: 9 | check: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/checkout@v4 13 | - uses: actions/setup-node@v4 14 | - run: npm run latest 15 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # spdx-license-ids 2 | 3 | [![npm version](https://img.shields.io/npm/v/spdx-license-ids.svg)](https://www.npmjs.com/package/spdx-license-ids) 4 | 5 | A list of [SPDX license](https://spdx.org/licenses/) identifiers 6 | 7 | ## Installation 8 | 9 | [Download JSON directly](https://raw.githubusercontent.com/jslicense/spdx-license-ids/main/index.json), or [use](https://docs.npmjs.com/cli/install) [npm](https://docs.npmjs.com/about-npm/): 10 | 11 | ``` 12 | npm install spdx-license-ids 13 | ``` 14 | 15 | ## [Node.js](https://nodejs.org/) API 16 | 17 | ### require('spdx-license-ids') 18 | 19 | Type: `string[]` 20 | 21 | All license IDs except for the currently deprecated ones. 22 | 23 | ```javascript 24 | const ids = require('spdx-license-ids'); 25 | //=> ['0BSD', 'AAL', 'ADSL', 'AFL-1.1', 'AFL-1.2', 'AFL-2.0', 'AFL-2.1', 'AFL-3.0', 'AGPL-1.0-only', ...] 26 | 27 | ids.includes('BSD-3-Clause'); //=> true 28 | ids.includes('CC-BY-1.0'); //=> true 29 | 30 | ids.includes('GPL-3.0'); //=> false 31 | ``` 32 | 33 | ### require('spdx-license-ids/deprecated') 34 | 35 | Type: `string[]` 36 | 37 | Deprecated license IDs. 38 | 39 | ```javascript 40 | const deprecatedIds = require('spdx-license-ids/deprecated'); 41 | //=> ['AGPL-1.0', 'AGPL-3.0', 'GFDL-1.1', 'GFDL-1.2', 'GFDL-1.3', 'GPL-1.0', 'GPL-2.0', ...] 42 | 43 | deprecatedIds.includes('BSD-3-Clause'); //=> false 44 | deprecatedIds.includes('CC-BY-1.0'); //=> false 45 | 46 | deprecatedIds.includes('GPL-3.0'); //=> true 47 | ``` 48 | 49 | ## License 50 | 51 | [Creative Commons Zero v1.0 Universal](https://creativecommons.org/publicdomain/zero/1.0/deed) 52 | -------------------------------------------------------------------------------- /build.js: -------------------------------------------------------------------------------- 1 | const https = require('https'); 2 | const fs = require('fs'); 3 | 4 | https.get('https://spdx.org/licenses/licenses.json', response => { 5 | const chunks = []; 6 | response 7 | .on('data', chunk => { 8 | chunks.push(chunk); 9 | }) 10 | .once('error', error => { 11 | throw error; 12 | }) 13 | .once('end', () => { 14 | const buffer = Buffer.concat(chunks); 15 | const data = JSON.parse(buffer); 16 | const {licenses} = data; 17 | const index = []; 18 | const deprecated = []; 19 | for (const {licenseId: id, isDeprecatedLicenseId: isDeprecated} of licenses) { 20 | if (isDeprecated) { 21 | if (!id.endsWith('+')) { 22 | deprecated.push(id); 23 | } 24 | } else { 25 | index.push(id); 26 | } 27 | } 28 | index.sort(); 29 | deprecated.sort(); 30 | fs.writeFileSync('index.json', stringify(index, null, 2)); 31 | fs.writeFileSync('deprecated.json', stringify(deprecated, null, 2)); 32 | }); 33 | }); 34 | 35 | function stringify(data) { 36 | return `${JSON.stringify(data, null, '\t')}\n`; 37 | } 38 | -------------------------------------------------------------------------------- /deprecated.json: -------------------------------------------------------------------------------- 1 | [ 2 | "AGPL-1.0", 3 | "AGPL-3.0", 4 | "BSD-2-Clause-FreeBSD", 5 | "BSD-2-Clause-NetBSD", 6 | "GFDL-1.1", 7 | "GFDL-1.2", 8 | "GFDL-1.3", 9 | "GPL-1.0", 10 | "GPL-2.0", 11 | "GPL-2.0-with-GCC-exception", 12 | "GPL-2.0-with-autoconf-exception", 13 | "GPL-2.0-with-bison-exception", 14 | "GPL-2.0-with-classpath-exception", 15 | "GPL-2.0-with-font-exception", 16 | "GPL-3.0", 17 | "GPL-3.0-with-GCC-exception", 18 | "GPL-3.0-with-autoconf-exception", 19 | "LGPL-2.0", 20 | "LGPL-2.1", 21 | "LGPL-3.0", 22 | "Net-SNMP", 23 | "Nunit", 24 | "StandardML-NJ", 25 | "bzip2-1.0.5", 26 | "eCos-2.0", 27 | "wxWindows" 28 | ] 29 | -------------------------------------------------------------------------------- /index.json: -------------------------------------------------------------------------------- 1 | [ 2 | "0BSD", 3 | "3D-Slicer-1.0", 4 | "AAL", 5 | "ADSL", 6 | "AFL-1.1", 7 | "AFL-1.2", 8 | "AFL-2.0", 9 | "AFL-2.1", 10 | "AFL-3.0", 11 | "AGPL-1.0-only", 12 | "AGPL-1.0-or-later", 13 | "AGPL-3.0-only", 14 | "AGPL-3.0-or-later", 15 | "AMD-newlib", 16 | "AMDPLPA", 17 | "AML", 18 | "AML-glslang", 19 | "AMPAS", 20 | "ANTLR-PD", 21 | "ANTLR-PD-fallback", 22 | "APAFML", 23 | "APL-1.0", 24 | "APSL-1.0", 25 | "APSL-1.1", 26 | "APSL-1.2", 27 | "APSL-2.0", 28 | "ASWF-Digital-Assets-1.0", 29 | "ASWF-Digital-Assets-1.1", 30 | "Abstyles", 31 | "AdaCore-doc", 32 | "Adobe-2006", 33 | "Adobe-Display-PostScript", 34 | "Adobe-Glyph", 35 | "Adobe-Utopia", 36 | "Afmparse", 37 | "Aladdin", 38 | "Apache-1.0", 39 | "Apache-1.1", 40 | "Apache-2.0", 41 | "App-s2p", 42 | "Arphic-1999", 43 | "Artistic-1.0", 44 | "Artistic-1.0-Perl", 45 | "Artistic-1.0-cl8", 46 | "Artistic-2.0", 47 | "BSD-1-Clause", 48 | "BSD-2-Clause", 49 | "BSD-2-Clause-Darwin", 50 | "BSD-2-Clause-Patent", 51 | "BSD-2-Clause-Views", 52 | "BSD-2-Clause-first-lines", 53 | "BSD-3-Clause", 54 | "BSD-3-Clause-Attribution", 55 | "BSD-3-Clause-Clear", 56 | "BSD-3-Clause-HP", 57 | "BSD-3-Clause-LBNL", 58 | "BSD-3-Clause-Modification", 59 | "BSD-3-Clause-No-Military-License", 60 | "BSD-3-Clause-No-Nuclear-License", 61 | "BSD-3-Clause-No-Nuclear-License-2014", 62 | "BSD-3-Clause-No-Nuclear-Warranty", 63 | "BSD-3-Clause-Open-MPI", 64 | "BSD-3-Clause-Sun", 65 | "BSD-3-Clause-acpica", 66 | "BSD-3-Clause-flex", 67 | "BSD-4-Clause", 68 | "BSD-4-Clause-Shortened", 69 | "BSD-4-Clause-UC", 70 | "BSD-4.3RENO", 71 | "BSD-4.3TAHOE", 72 | "BSD-Advertising-Acknowledgement", 73 | "BSD-Attribution-HPND-disclaimer", 74 | "BSD-Inferno-Nettverk", 75 | "BSD-Protection", 76 | "BSD-Source-Code", 77 | "BSD-Source-beginning-file", 78 | "BSD-Systemics", 79 | "BSD-Systemics-W3Works", 80 | "BSL-1.0", 81 | "BUSL-1.1", 82 | "Baekmuk", 83 | "Bahyph", 84 | "Barr", 85 | "Beerware", 86 | "BitTorrent-1.0", 87 | "BitTorrent-1.1", 88 | "Bitstream-Charter", 89 | "Bitstream-Vera", 90 | "BlueOak-1.0.0", 91 | "Boehm-GC", 92 | "Boehm-GC-without-fee", 93 | "Borceux", 94 | "Brian-Gladman-2-Clause", 95 | "Brian-Gladman-3-Clause", 96 | "C-UDA-1.0", 97 | "CAL-1.0", 98 | "CAL-1.0-Combined-Work-Exception", 99 | "CATOSL-1.1", 100 | "CC-BY-1.0", 101 | "CC-BY-2.0", 102 | "CC-BY-2.5", 103 | "CC-BY-2.5-AU", 104 | "CC-BY-3.0", 105 | "CC-BY-3.0-AT", 106 | "CC-BY-3.0-AU", 107 | "CC-BY-3.0-DE", 108 | "CC-BY-3.0-IGO", 109 | "CC-BY-3.0-NL", 110 | "CC-BY-3.0-US", 111 | "CC-BY-4.0", 112 | "CC-BY-NC-1.0", 113 | "CC-BY-NC-2.0", 114 | "CC-BY-NC-2.5", 115 | "CC-BY-NC-3.0", 116 | "CC-BY-NC-3.0-DE", 117 | "CC-BY-NC-4.0", 118 | "CC-BY-NC-ND-1.0", 119 | "CC-BY-NC-ND-2.0", 120 | "CC-BY-NC-ND-2.5", 121 | "CC-BY-NC-ND-3.0", 122 | "CC-BY-NC-ND-3.0-DE", 123 | "CC-BY-NC-ND-3.0-IGO", 124 | "CC-BY-NC-ND-4.0", 125 | "CC-BY-NC-SA-1.0", 126 | "CC-BY-NC-SA-2.0", 127 | "CC-BY-NC-SA-2.0-DE", 128 | "CC-BY-NC-SA-2.0-FR", 129 | "CC-BY-NC-SA-2.0-UK", 130 | "CC-BY-NC-SA-2.5", 131 | "CC-BY-NC-SA-3.0", 132 | "CC-BY-NC-SA-3.0-DE", 133 | "CC-BY-NC-SA-3.0-IGO", 134 | "CC-BY-NC-SA-4.0", 135 | "CC-BY-ND-1.0", 136 | "CC-BY-ND-2.0", 137 | "CC-BY-ND-2.5", 138 | "CC-BY-ND-3.0", 139 | "CC-BY-ND-3.0-DE", 140 | "CC-BY-ND-4.0", 141 | "CC-BY-SA-1.0", 142 | "CC-BY-SA-2.0", 143 | "CC-BY-SA-2.0-UK", 144 | "CC-BY-SA-2.1-JP", 145 | "CC-BY-SA-2.5", 146 | "CC-BY-SA-3.0", 147 | "CC-BY-SA-3.0-AT", 148 | "CC-BY-SA-3.0-DE", 149 | "CC-BY-SA-3.0-IGO", 150 | "CC-BY-SA-4.0", 151 | "CC-PDDC", 152 | "CC-PDM-1.0", 153 | "CC-SA-1.0", 154 | "CC0-1.0", 155 | "CDDL-1.0", 156 | "CDDL-1.1", 157 | "CDL-1.0", 158 | "CDLA-Permissive-1.0", 159 | "CDLA-Permissive-2.0", 160 | "CDLA-Sharing-1.0", 161 | "CECILL-1.0", 162 | "CECILL-1.1", 163 | "CECILL-2.0", 164 | "CECILL-2.1", 165 | "CECILL-B", 166 | "CECILL-C", 167 | "CERN-OHL-1.1", 168 | "CERN-OHL-1.2", 169 | "CERN-OHL-P-2.0", 170 | "CERN-OHL-S-2.0", 171 | "CERN-OHL-W-2.0", 172 | "CFITSIO", 173 | "CMU-Mach", 174 | "CMU-Mach-nodoc", 175 | "CNRI-Jython", 176 | "CNRI-Python", 177 | "CNRI-Python-GPL-Compatible", 178 | "COIL-1.0", 179 | "CPAL-1.0", 180 | "CPL-1.0", 181 | "CPOL-1.02", 182 | "CUA-OPL-1.0", 183 | "Caldera", 184 | "Caldera-no-preamble", 185 | "Catharon", 186 | "ClArtistic", 187 | "Clips", 188 | "Community-Spec-1.0", 189 | "Condor-1.1", 190 | "Cornell-Lossless-JPEG", 191 | "Cronyx", 192 | "Crossword", 193 | "CrystalStacker", 194 | "Cube", 195 | "D-FSL-1.0", 196 | "DEC-3-Clause", 197 | "DL-DE-BY-2.0", 198 | "DL-DE-ZERO-2.0", 199 | "DOC", 200 | "DRL-1.0", 201 | "DRL-1.1", 202 | "DSDP", 203 | "DocBook-Schema", 204 | "DocBook-Stylesheet", 205 | "DocBook-XML", 206 | "Dotseqn", 207 | "ECL-1.0", 208 | "ECL-2.0", 209 | "EFL-1.0", 210 | "EFL-2.0", 211 | "EPICS", 212 | "EPL-1.0", 213 | "EPL-2.0", 214 | "EUDatagrid", 215 | "EUPL-1.0", 216 | "EUPL-1.1", 217 | "EUPL-1.2", 218 | "Elastic-2.0", 219 | "Entessa", 220 | "ErlPL-1.1", 221 | "Eurosym", 222 | "FBM", 223 | "FDK-AAC", 224 | "FSFAP", 225 | "FSFAP-no-warranty-disclaimer", 226 | "FSFUL", 227 | "FSFULLR", 228 | "FSFULLRWD", 229 | "FTL", 230 | "Fair", 231 | "Ferguson-Twofish", 232 | "Frameworx-1.0", 233 | "FreeBSD-DOC", 234 | "FreeImage", 235 | "Furuseth", 236 | "GCR-docs", 237 | "GD", 238 | "GFDL-1.1-invariants-only", 239 | "GFDL-1.1-invariants-or-later", 240 | "GFDL-1.1-no-invariants-only", 241 | "GFDL-1.1-no-invariants-or-later", 242 | "GFDL-1.1-only", 243 | "GFDL-1.1-or-later", 244 | "GFDL-1.2-invariants-only", 245 | "GFDL-1.2-invariants-or-later", 246 | "GFDL-1.2-no-invariants-only", 247 | "GFDL-1.2-no-invariants-or-later", 248 | "GFDL-1.2-only", 249 | "GFDL-1.2-or-later", 250 | "GFDL-1.3-invariants-only", 251 | "GFDL-1.3-invariants-or-later", 252 | "GFDL-1.3-no-invariants-only", 253 | "GFDL-1.3-no-invariants-or-later", 254 | "GFDL-1.3-only", 255 | "GFDL-1.3-or-later", 256 | "GL2PS", 257 | "GLWTPL", 258 | "GPL-1.0-only", 259 | "GPL-1.0-or-later", 260 | "GPL-2.0-only", 261 | "GPL-2.0-or-later", 262 | "GPL-3.0-only", 263 | "GPL-3.0-or-later", 264 | "Giftware", 265 | "Glide", 266 | "Glulxe", 267 | "Graphics-Gems", 268 | "Gutmann", 269 | "HIDAPI", 270 | "HP-1986", 271 | "HP-1989", 272 | "HPND", 273 | "HPND-DEC", 274 | "HPND-Fenneberg-Livingston", 275 | "HPND-INRIA-IMAG", 276 | "HPND-Intel", 277 | "HPND-Kevlin-Henney", 278 | "HPND-MIT-disclaimer", 279 | "HPND-Markus-Kuhn", 280 | "HPND-Netrek", 281 | "HPND-Pbmplus", 282 | "HPND-UC", 283 | "HPND-UC-export-US", 284 | "HPND-doc", 285 | "HPND-doc-sell", 286 | "HPND-export-US", 287 | "HPND-export-US-acknowledgement", 288 | "HPND-export-US-modify", 289 | "HPND-export2-US", 290 | "HPND-merchantability-variant", 291 | "HPND-sell-MIT-disclaimer-xserver", 292 | "HPND-sell-regexpr", 293 | "HPND-sell-variant", 294 | "HPND-sell-variant-MIT-disclaimer", 295 | "HPND-sell-variant-MIT-disclaimer-rev", 296 | "HTMLTIDY", 297 | "HaskellReport", 298 | "Hippocratic-2.1", 299 | "IBM-pibs", 300 | "ICU", 301 | "IEC-Code-Components-EULA", 302 | "IJG", 303 | "IJG-short", 304 | "IPA", 305 | "IPL-1.0", 306 | "ISC", 307 | "ISC-Veillard", 308 | "ImageMagick", 309 | "Imlib2", 310 | "Info-ZIP", 311 | "Inner-Net-2.0", 312 | "InnoSetup", 313 | "Intel", 314 | "Intel-ACPI", 315 | "Interbase-1.0", 316 | "JPL-image", 317 | "JPNIC", 318 | "JSON", 319 | "Jam", 320 | "JasPer-2.0", 321 | "Kastrup", 322 | "Kazlib", 323 | "Knuth-CTAN", 324 | "LAL-1.2", 325 | "LAL-1.3", 326 | "LGPL-2.0-only", 327 | "LGPL-2.0-or-later", 328 | "LGPL-2.1-only", 329 | "LGPL-2.1-or-later", 330 | "LGPL-3.0-only", 331 | "LGPL-3.0-or-later", 332 | "LGPLLR", 333 | "LOOP", 334 | "LPD-document", 335 | "LPL-1.0", 336 | "LPL-1.02", 337 | "LPPL-1.0", 338 | "LPPL-1.1", 339 | "LPPL-1.2", 340 | "LPPL-1.3a", 341 | "LPPL-1.3c", 342 | "LZMA-SDK-9.11-to-9.20", 343 | "LZMA-SDK-9.22", 344 | "Latex2e", 345 | "Latex2e-translated-notice", 346 | "Leptonica", 347 | "LiLiQ-P-1.1", 348 | "LiLiQ-R-1.1", 349 | "LiLiQ-Rplus-1.1", 350 | "Libpng", 351 | "Linux-OpenIB", 352 | "Linux-man-pages-1-para", 353 | "Linux-man-pages-copyleft", 354 | "Linux-man-pages-copyleft-2-para", 355 | "Linux-man-pages-copyleft-var", 356 | "Lucida-Bitmap-Fonts", 357 | "MIPS", 358 | "MIT", 359 | "MIT-0", 360 | "MIT-CMU", 361 | "MIT-Click", 362 | "MIT-Festival", 363 | "MIT-Khronos-old", 364 | "MIT-Modern-Variant", 365 | "MIT-Wu", 366 | "MIT-advertising", 367 | "MIT-enna", 368 | "MIT-feh", 369 | "MIT-open-group", 370 | "MIT-testregex", 371 | "MITNFA", 372 | "MMIXware", 373 | "MPEG-SSG", 374 | "MPL-1.0", 375 | "MPL-1.1", 376 | "MPL-2.0", 377 | "MPL-2.0-no-copyleft-exception", 378 | "MS-LPL", 379 | "MS-PL", 380 | "MS-RL", 381 | "MTLL", 382 | "Mackerras-3-Clause", 383 | "Mackerras-3-Clause-acknowledgment", 384 | "MakeIndex", 385 | "Martin-Birgmeier", 386 | "McPhee-slideshow", 387 | "Minpack", 388 | "MirOS", 389 | "Motosoto", 390 | "MulanPSL-1.0", 391 | "MulanPSL-2.0", 392 | "Multics", 393 | "Mup", 394 | "NAIST-2003", 395 | "NASA-1.3", 396 | "NBPL-1.0", 397 | "NCBI-PD", 398 | "NCGL-UK-2.0", 399 | "NCL", 400 | "NCSA", 401 | "NGPL", 402 | "NICTA-1.0", 403 | "NIST-PD", 404 | "NIST-PD-fallback", 405 | "NIST-Software", 406 | "NLOD-1.0", 407 | "NLOD-2.0", 408 | "NLPL", 409 | "NOSL", 410 | "NPL-1.0", 411 | "NPL-1.1", 412 | "NPOSL-3.0", 413 | "NRL", 414 | "NTP", 415 | "NTP-0", 416 | "Naumen", 417 | "NetCDF", 418 | "Newsletr", 419 | "Nokia", 420 | "Noweb", 421 | "O-UDA-1.0", 422 | "OAR", 423 | "OCCT-PL", 424 | "OCLC-2.0", 425 | "ODC-By-1.0", 426 | "ODbL-1.0", 427 | "OFFIS", 428 | "OFL-1.0", 429 | "OFL-1.0-RFN", 430 | "OFL-1.0-no-RFN", 431 | "OFL-1.1", 432 | "OFL-1.1-RFN", 433 | "OFL-1.1-no-RFN", 434 | "OGC-1.0", 435 | "OGDL-Taiwan-1.0", 436 | "OGL-Canada-2.0", 437 | "OGL-UK-1.0", 438 | "OGL-UK-2.0", 439 | "OGL-UK-3.0", 440 | "OGTSL", 441 | "OLDAP-1.1", 442 | "OLDAP-1.2", 443 | "OLDAP-1.3", 444 | "OLDAP-1.4", 445 | "OLDAP-2.0", 446 | "OLDAP-2.0.1", 447 | "OLDAP-2.1", 448 | "OLDAP-2.2", 449 | "OLDAP-2.2.1", 450 | "OLDAP-2.2.2", 451 | "OLDAP-2.3", 452 | "OLDAP-2.4", 453 | "OLDAP-2.5", 454 | "OLDAP-2.6", 455 | "OLDAP-2.7", 456 | "OLDAP-2.8", 457 | "OLFL-1.3", 458 | "OML", 459 | "OPL-1.0", 460 | "OPL-UK-3.0", 461 | "OPUBL-1.0", 462 | "OSET-PL-2.1", 463 | "OSL-1.0", 464 | "OSL-1.1", 465 | "OSL-2.0", 466 | "OSL-2.1", 467 | "OSL-3.0", 468 | "OpenPBS-2.3", 469 | "OpenSSL", 470 | "OpenSSL-standalone", 471 | "OpenVision", 472 | "PADL", 473 | "PDDL-1.0", 474 | "PHP-3.0", 475 | "PHP-3.01", 476 | "PPL", 477 | "PSF-2.0", 478 | "Parity-6.0.0", 479 | "Parity-7.0.0", 480 | "Pixar", 481 | "Plexus", 482 | "PolyForm-Noncommercial-1.0.0", 483 | "PolyForm-Small-Business-1.0.0", 484 | "PostgreSQL", 485 | "Python-2.0", 486 | "Python-2.0.1", 487 | "QPL-1.0", 488 | "QPL-1.0-INRIA-2004", 489 | "Qhull", 490 | "RHeCos-1.1", 491 | "RPL-1.1", 492 | "RPL-1.5", 493 | "RPSL-1.0", 494 | "RSA-MD", 495 | "RSCPL", 496 | "Rdisc", 497 | "Ruby", 498 | "Ruby-pty", 499 | "SAX-PD", 500 | "SAX-PD-2.0", 501 | "SCEA", 502 | "SGI-B-1.0", 503 | "SGI-B-1.1", 504 | "SGI-B-2.0", 505 | "SGI-OpenGL", 506 | "SGP4", 507 | "SHL-0.5", 508 | "SHL-0.51", 509 | "SISSL", 510 | "SISSL-1.2", 511 | "SL", 512 | "SMAIL-GPL", 513 | "SMLNJ", 514 | "SMPPL", 515 | "SNIA", 516 | "SPL-1.0", 517 | "SSH-OpenSSH", 518 | "SSH-short", 519 | "SSLeay-standalone", 520 | "SSPL-1.0", 521 | "SWL", 522 | "Saxpath", 523 | "SchemeReport", 524 | "Sendmail", 525 | "Sendmail-8.23", 526 | "Sendmail-Open-Source-1.1", 527 | "SimPL-2.0", 528 | "Sleepycat", 529 | "Soundex", 530 | "Spencer-86", 531 | "Spencer-94", 532 | "Spencer-99", 533 | "SugarCRM-1.1.3", 534 | "Sun-PPP", 535 | "Sun-PPP-2000", 536 | "SunPro", 537 | "Symlinks", 538 | "TAPR-OHL-1.0", 539 | "TCL", 540 | "TCP-wrappers", 541 | "TGPPL-1.0", 542 | "TMate", 543 | "TORQUE-1.1", 544 | "TOSL", 545 | "TPDL", 546 | "TPL-1.0", 547 | "TTWL", 548 | "TTYP0", 549 | "TU-Berlin-1.0", 550 | "TU-Berlin-2.0", 551 | "TermReadKey", 552 | "ThirdEye", 553 | "TrustedQSL", 554 | "UCAR", 555 | "UCL-1.0", 556 | "UMich-Merit", 557 | "UPL-1.0", 558 | "URT-RLE", 559 | "Ubuntu-font-1.0", 560 | "Unicode-3.0", 561 | "Unicode-DFS-2015", 562 | "Unicode-DFS-2016", 563 | "Unicode-TOU", 564 | "UnixCrypt", 565 | "Unlicense", 566 | "VOSTROM", 567 | "VSL-1.0", 568 | "Vim", 569 | "W3C", 570 | "W3C-19980720", 571 | "W3C-20150513", 572 | "WTFPL", 573 | "Watcom-1.0", 574 | "Widget-Workshop", 575 | "Wsuipa", 576 | "X11", 577 | "X11-distribute-modifications-variant", 578 | "X11-swapped", 579 | "XFree86-1.1", 580 | "XSkat", 581 | "Xdebug-1.03", 582 | "Xerox", 583 | "Xfig", 584 | "Xnet", 585 | "YPL-1.0", 586 | "YPL-1.1", 587 | "ZPL-1.1", 588 | "ZPL-2.0", 589 | "ZPL-2.1", 590 | "Zed", 591 | "Zeeff", 592 | "Zend-2.0", 593 | "Zimbra-1.3", 594 | "Zimbra-1.4", 595 | "Zlib", 596 | "any-OSI", 597 | "any-OSI-perl-modules", 598 | "bcrypt-Solar-Designer", 599 | "blessing", 600 | "bzip2-1.0.6", 601 | "check-cvs", 602 | "checkmk", 603 | "copyleft-next-0.3.0", 604 | "copyleft-next-0.3.1", 605 | "curl", 606 | "cve-tou", 607 | "diffmark", 608 | "dtoa", 609 | "dvipdfm", 610 | "eGenix", 611 | "etalab-2.0", 612 | "fwlw", 613 | "gSOAP-1.3b", 614 | "generic-xts", 615 | "gnuplot", 616 | "gtkbook", 617 | "hdparm", 618 | "iMatix", 619 | "libpng-2.0", 620 | "libselinux-1.0", 621 | "libtiff", 622 | "libutil-David-Nugent", 623 | "lsof", 624 | "magaz", 625 | "mailprio", 626 | "metamail", 627 | "mpi-permissive", 628 | "mpich2", 629 | "mplus", 630 | "pkgconf", 631 | "pnmstitch", 632 | "psfrag", 633 | "psutils", 634 | "python-ldap", 635 | "radvd", 636 | "snprintf", 637 | "softSurfer", 638 | "ssh-keyscan", 639 | "swrule", 640 | "threeparttable", 641 | "ulem", 642 | "w3m", 643 | "wwl", 644 | "xinetd", 645 | "xkeyboard-config-Zinoviev", 646 | "xlock", 647 | "xpp", 648 | "xzoom", 649 | "zlib-acknowledgement" 650 | ] 651 | -------------------------------------------------------------------------------- /latest.js: -------------------------------------------------------------------------------- 1 | const assert = require('assert'); 2 | 3 | // Download JSON file from spdx.org. 4 | require('https').request('https://spdx.org/licenses/licenses.json') 5 | .once('response', response => { 6 | assert.strictEqual(response.statusCode, 200); 7 | const chunks = []; 8 | response 9 | .on('data', chunk => { 10 | chunks.push(chunk); 11 | }) 12 | .once('error', error => { 13 | assert.ifError(error); 14 | }) 15 | .once('end', () => { 16 | const buffer = Buffer.concat(chunks); 17 | const spdxJSON = JSON.parse(buffer); 18 | const listVersion = spdxJSON.licenseListVersion; 19 | console.log(`License List Version: ${listVersion}`); 20 | const identifiers = []; 21 | const deprecated = []; 22 | spdxJSON.licenses.forEach(object => { 23 | const id = object.licenseId; 24 | if (id.endsWith('+')) { 25 | return; 26 | } 27 | if (object.isDeprecatedLicenseId) { 28 | deprecated.push(id); 29 | } else { 30 | identifiers.push(id); 31 | } 32 | }); 33 | identifiers.sort(); 34 | deprecated.sort(); 35 | 36 | const indexJSON = require('./index'); 37 | const deprecatedJSON = require('./deprecated'); 38 | 39 | identifiers.forEach(identifier => { 40 | assert(indexJSON.includes(identifier), `Missing: ${identifier}`); 41 | }); 42 | indexJSON.forEach(identifier => { 43 | assert(identifiers.includes(identifier), `Extra: ${identifier}`); 44 | }); 45 | assert.deepStrictEqual(indexJSON, identifiers, 'identifiers'); 46 | console.log('index.json is up to date.'); 47 | 48 | deprecated.forEach(identifier => { 49 | assert(deprecatedJSON.includes(identifier), `Missing Deprecated: ${identifier}`); 50 | }); 51 | deprecatedJSON.forEach(identifier => { 52 | assert(deprecated.includes(identifier), `Extra Deprecated: ${identifier}`); 53 | }); 54 | assert.deepStrictEqual(deprecatedJSON, deprecated, 'deprecated'); 55 | console.log('deprecated.json is up to date.'); 56 | }); 57 | }) 58 | .end(); 59 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "spdx-license-ids", 3 | "version": "3.0.21", 4 | "description": "A list of SPDX license identifiers", 5 | "repository": "jslicense/spdx-license-ids", 6 | "author": "Shinnosuke Watanabe (https://github.com/shinnn)", 7 | "license": "CC0-1.0", 8 | "scripts": { 9 | "build": "node build.js", 10 | "latest": "node latest.js", 11 | "pretest": "npm run build", 12 | "test": "node test.js" 13 | }, 14 | "files": [ 15 | "deprecated.json", 16 | "index.json" 17 | ], 18 | "keywords": [ 19 | "spdx", 20 | "license", 21 | "licenses", 22 | "id", 23 | "identifier", 24 | "identifiers", 25 | "json", 26 | "array", 27 | "oss" 28 | ] 29 | } 30 | -------------------------------------------------------------------------------- /test.js: -------------------------------------------------------------------------------- 1 | const test = require('node:test'); 2 | const assert = require('assert'); 3 | const deprecated = require('./deprecated'); 4 | const valid = require('.'); 5 | 6 | test('require(\'spdx-license-ids\')', t => { 7 | assert(Array.isArray(valid), 'should be an array.'); 8 | 9 | assert( 10 | valid.includes('LGPL-3.0-or-later'), 11 | 'should include non-deprecated license IDs.' 12 | ); 13 | 14 | assert( 15 | !valid.includes('Nunit'), 16 | 'should not include deprecated license IDs.' 17 | ); 18 | }); 19 | 20 | test('require(\'spdx-license-ids/deprecated\')', t => { 21 | assert(Array.isArray(deprecated), 'should be an array.'); 22 | 23 | assert( 24 | deprecated.length < valid.length, 25 | 'should be smaller than the main export.' 26 | ); 27 | 28 | assert( 29 | deprecated.includes('eCos-2.0'), 30 | 'should include deprecated license IDs.' 31 | ); 32 | 33 | assert( 34 | !deprecated.includes('ISC'), 35 | 'should not include non-deprecated license IDs.' 36 | ); 37 | }); 38 | --------------------------------------------------------------------------------