Git Product home page Git Product logo

spdx-license-list's Introduction

spdx-license-list

List of SPDX licenses

The lists of licenses are just JSON files and can be used anywhere.

Using SPDX License List version 3.23 (2024-02-08)

Install

npm install spdx-license-list

Usage

const spdxLicenseList = require('spdx-license-list');

console.log(spdxLicenseList.MIT);
/*
{
	name: 'MIT License',
	url: 'http://www.opensource.org/licenses/MIT',
	osiApproved: true
}
*/
const mitLicense = require('spdx-license-list/licenses/MIT');

console.log(mitLicense.licenseText);
//=> 'MIT License\r\n\r\nCopyright (c) <year> <copyright holders> …'

You can also get a version with the licence text included:

const spdxLicenseList = require('spdx-license-list/full');

console.log(spdxLicenseList.MIT);
/*
{
	name: 'MIT License',
	url: 'http://www.opensource.org/licenses/MIT',
	osiApproved: true,
	licenseText: '…'
}
*/

Or just the license IDs as a Set:

const spdxLicenseList = require('spdx-license-list/simple');

console.log(spdxLicenseList);
//=> Set {'Glide', 'Abstyles', …}

API

spdxLicenseList

Type: object

The licenses are indexed by their identifier and contains a name property with the full name of the license, url with the URL to the license, and osiApproved boolean for whether the license is OSI Approved.

spdx-license-list's People

Contributors

danielhusar avatar ddgenome avatar himynameisdave avatar koppor avatar larsgw avatar mlinksva avatar richienb avatar sindresorhus avatar sschuberth avatar tiagodanin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spdx-license-list's Issues

Thoughts on license-generator (string variable interpolation)?

Currently there exists a package https://github.com/arshad/license-generator which is outdated/does not have all the licenses available I believe.

@sindresorhus I was curious if you experimented at all with interpolation of variable names <name>, <year>, etc. It'd be very convenient for generating packages

I do understand though that NPM, GitHub, and Choose a License/Shields.io look at package.json for license prop - though I think it seems a standard to also include a LICENSE file?

Update to SPDX version 3.6 2019-07-10

Could this package be updated to use the licenses of SPDX version 3.6 2019-07-10?
From the code it would seem that you can regenerate and push the updates.

Generate licenses?

Can the license text be used to generate licenses? It seems that the text actually contains not just the full license text but SPDX markup for matching purposes. Is there a parser for this markup that could be fed with user-provided settings?

Dynamically generate the JSON files

The current JSON file is manually created. Would be nice to have a script for this.

How about precomputing two JSON files, one minimal spdx.json with just the current metadata (+ link to the license), and one spdx-full.json that also includes the licenses (which would be the one we use in Node)?

One bi-effect of #1 is that there is now a https://github.com/sindresorhus/spdx-license-list/blob/master/licenses/spdx_licenselist_v1.20.xls with the metadata. So could potentially just parse that one.

@danielhusar Interested?

FYI: SPDX is Working on Structured-Data License Text Forms

The SPDX working groups have put a lot of effort into translating the license text forms into a machine-readable template format. That work is here:

https://github.com/spdx/license-list-XML

They have not yet blessed the XML repository as "ready" or "official". But progress has been very good. If and when it's ready, you may prefer to consume that source for license texts.

cc @jlovejoy @bradleeedmondson, with a quick note: This is one of a few packages in the Node.js/JavaScript ecosystem that packages up and publishes the license list as a data library. Most of these use scripts to pull down JSON or other files from spdx.org. This package pulls down license texts in addition to list metadata. spdx-license-ids is just license IDs.

Change to CC0

@danielhusar, @sschuberth, are you willing to apply Creative Commons CC0 to your contributions to this package, as well? See 16d0a9f

I see that you've each made only one or two commits here, but they look significant! I'm not sure what, if any, of the current code derives from yours. But it would be nice to be clear about the terms change.

Clean up junk files

Seems like #1 brought with it some junk files in the licenses folder that could use cleaning up.

Problem with APL-1.0

When loading the module into meteor which does parsing of the JSON files

node_modules/spdx-license-list/spdx-full.json:54:15: Unterminated string constant (54:15)

appears on the logs

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.