
Research
/Security News
Contagious Interview Campaign Escalates With 67 Malicious npm Packages and New Malware Loader
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.
@ndla/licenses
Advanced tools
A simple library for retrieving license information by abbreviation (and locale).
yarn add @ndla/licenses
npm install @ndla/licenses
import { licenses, getLicenseByAbbreviation } from "@ndla/licenses";
const license = getLicenseByAbbreviation(licenses.CC_BY_NC_4, "en");
console.log(license);
//> { short: 'Free use', title: 'Attribution-NonCommercial', description: 'This license...', rights: ['by', 'sa'] }
// defaults to Norsk Bokmål (nb)
const license = getLicenseByAbbreviation(licenses.CC_BY_NC_4, "unknown-locale");
console.log(license);
//> { short: 'Fri bruk', title: 'Navngivelse-IkkeKommersiell', description: 'Denne lisensen...', rights: ['by', 'sa'] }
// returns abbreviation if license is unknown
const license = getLicenseByAbbreviation("unknown-license", "en");
console.log(license);
//> { short: 'unknown-license', title: 'unknown-license', description: 'unknown-license', rights: [] }
import { getLicenseRightByAbbreviation, rights } from "@ndla/licenses";
const licenseRight = getLicenseRightByAbbreviation(rights.BY, "en");
console.log(licenseRight);
//> { short: 'cc', title: 'Copyright', userFriendlyTitle: 'Copyright', description: 'Only the creator can derive...' }
// defaults to Norsk Bokmål (nb)
const licenseRight = getLicenseRightByAbbreviation(rights.CC, "unknown-locale");
console.log(licenseRight);
//> { short: 'cc', title: 'Copyright', userFriendlyTitle: 'Opphavsrett', description: 'Bare opphavspersonen kan bearbeide...' }
// returns abbreviation if licenseRight is unknown
const licenseRight = getLicenseRightByAbbreviation("unknown-lr", "en");
console.log(licenseRight);
//> { short: 'unknown-lr', title: 'unknown-lr', userFriendlyTitle: 'unknown-lr', description: 'unknown-lr'}
import { rights } from "@ndla/licenses";
import Icon from "./Icons";
const LicenseIcon = ({ licenseRight }) => {
switch (licenseRight) {
case rights.BY:
return <Icon.LicenseBy />;
case rights.SA:
return <Icon.LicenseSa />;
default:
return undefined;
}
};
Available constants in rights object:
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' | Creative Commons |
COPYRIGHTED | 'copyrighted' | Copyrighted |
NA | 'n/a' | Not Appliccable |
FAQs
A simple library for retrieving license information for NDLA
The npm package @ndla/licenses receives a total of 725 weekly downloads. As such, @ndla/licenses popularity was classified as not popular.
We found that @ndla/licenses demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.