ndla-licenses
A simple library for retrieving license information by abbreviation (and locale).
Installation
$ npm install ndla-licenses
Usage
Get license by abbreviation
; const license = ; console;//> { short: 'Free use', title: 'Attribution-NonCommercial', description: 'This license...', rights: ['by', 'sa'] } // defaults to Norsk Bokmål (nb)const license = ;console;//> { short: 'Fri bruk', title: 'Navngivelse-IkkeKommersiell', description: 'Denne lisensen...', rights: ['by', 'sa'] } // returns abbreviation if license is unknownconst license = ;console;//> { short: 'unknown-license', title: 'unknown-license', description: 'unknown-license', rights: [] }
Get license right info by abbreviation/constant
; const licenseRight = ; console;//> { short: 'cc', title: 'Copyright', userFriendlyTitle: 'Copyright', description: 'Only the creator can derive...' } // defaults to Norsk Bokmål (nb)const licenseRight = ;console;//> { short: 'cc', title: 'Copyright', userFriendlyTitle: 'Opphavsrett', description: 'Bare opphavspersonen kan bearbeide...' } // returns abbreviation if licenseRight is unknownconst licenseRight = ;console;//> { short: 'unknown-lr', title: 'unknown-lr', userFriendlyTitle: 'unknown-lr', description: 'unknown-lr'}
License right constants
;;; const LicenseIcon = { };
Available constants:
Exported name | Value | Description |
---|---|---|
BY |
'by' |
Attribution |
SA |
'sa' |
Share-alike |
NC |
'nc' |
Non-commercial |
ND |
'nd' |
No derivative work |
PD |
'pd' |
Public Domain |
CC0 |
'cc0' |
Public Domain Dedication |
CC |
'cc' |
Copyright |