@egoistdeveloper/operating-system-logos
Advanced tools
Comparing version 1.2.2 to 1.2.3
{ | ||
"name": "@egoistdeveloper/operating-system-logos", | ||
"version": "1.2.2", | ||
"version": "1.2.3", | ||
"description": "Operating System Logos in Different Sizes", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
# operating-system-logos | ||
Operating system logos in different sizes | ||
@@ -7,2 +6,4 @@ ![EgoistDeveloper operating-system-logos](https://preview.dragon-code.pro/EgoistDeveloper/operating-system-logos.svg) | ||
OS logos or operating system logo list in different sizes. It helps statistic or log listing and graph visualising. | ||
## Installation | ||
@@ -23,10 +24,13 @@ | ||
## List of operating system names and custom short codes | ||
Image files are named according to these titles (*see the **[reference](https://github.com/matomo-org/device-detector/blob/228eef9a40f611a6661f1c93ee64c2c687dd3f11/Parser/OperatingSystem.php#L40)***). Current and frequently used logos defining operating systems were selected. Therefore, the version or naming differences were ignored when listing. | ||
All icons listing `.png` format. | ||
β unavailable\ | ||
β available\ | ||
β not completed | ||
## List of operating system names and short codes | ||
Image files are named according to these name (*see the **[reference](https://github.com/matomo-org/device-detector/blob/228eef9a40f611a6661f1c93ee64c2c687dd3f11/Parser/OperatingSystem.php#L40)***). Current and frequently used logos defining operating systems were selected. Therefore, the version or naming differences were ignored when listing. | ||
There is no standard or formula for OS cataloging. This project uses above referenced alpha3 codes and generic names. There are many solution for OS name showing and we can use below listing methods. We can search in `slug/name` list then use matched result code for showing os icon file (yes, I know it is not the best way. we can discuss). | ||
Alpha3 list [alpha3-list.json](./src/alpha3-list.json) and slug list [slug-list.json](./src/os-list.json). | ||
## Preview List | ||
@@ -127,4 +131,11 @@ | ||
## Contribution | ||
When you find a lost os icon, add related folders with required sizes (*listed above*). Then add unique uppercase alpha3 short code (*also this is going to be filename*) and with name to `list.json`. Finally go to `src` folder and run `node list.js` command (*obviously nodejs must be installed*). `list.js` generates automatically preview list and updates this `readme.md` file (*this option useful for multiple icons*). All files must be `.png` format. | ||
Also this repo open for SVG support, waiting PR's. | ||
## Legal | ||
All logos and trademarks are the property of their respective owners! | ||
If you represent the entity that has the rights over a logo and you want, for whatever reason, that logo removed from this project, **[open an issue](https://github.com/EgoistDeveloper/operating-system-logos/issues/new)** requesting its takedown and we will remove it as soon as possible. | ||
If you represent the entity that has the rights over a logo and you want, for whatever reason, that logo removed from this project, **[open an issue](https://github.com/EgoistDeveloper/operating-system-logos/issues/new)** requesting its takedown and we will remove it as soon as possible. |
/** | ||
* This simple server generates available logo list for readme table in markdown format | ||
* Server start: node list.js | ||
* This preview generator is used to generate the preview for the list of | ||
* Run script: node list.js | ||
*/ | ||
@@ -12,2 +12,7 @@ | ||
/** | ||
* Update readme preview list | ||
* | ||
* @param {string} newData | ||
*/ | ||
function updateList(newData) { | ||
@@ -22,3 +27,3 @@ fs.readFile('./../README.md', 'utf8', (err, data) => { | ||
if (data) { | ||
const match = data.match('<!-- TABLE_START -->((.|\n|\s|\r)*)<!-- TABLE_END -->');; | ||
const match = data.match('<!-- TABLE_START -->((.|\n|\s|\r)*)<!-- TABLE_END -->'); | ||
@@ -39,6 +44,19 @@ if (match && match[1]) { | ||
function copyWithSlug(osCode, osName) { | ||
const slug = osName.toLowerCase().replace(/ /g,'-').replace(/[-]+/g, '-').replace(/[^\w-]+/g,''); | ||
const slugItem = { | ||
code: osCode, | ||
name: osName, | ||
slug: slug | ||
}; | ||
return slugItem; | ||
} | ||
try { | ||
let osList = JSON.parse(fs.readFileSync('list.json')), | ||
let osList = JSON.parse(fs.readFileSync('alpha3-list.json')), | ||
tableMarkdown = `| Preview | Code | Name | Status |\n| ------- | ---- | ---- | ------ |\n`, | ||
availableItems = 0; | ||
availableItems = 0, | ||
slugList = []; | ||
@@ -70,6 +88,8 @@ osList = Object.entries(osList); | ||
// console.log(`β ${osName} (${osCode}): all logos not found.\n--------------------------`); | ||
console.log(`β ${osName} (${osCode}): all logos not found.\n--------------------------`); | ||
} else if (logoStackCount == sizeList.length) { | ||
tableMarkdown += `| ![](${baseRepoAddress}/src/${previewSize}/${osCode}.png "${osCode} (${previewSize})") | ${osCode} | ${osName} | β |\n`; | ||
slugList.push(copyWithSlug(osCode, osName)); | ||
availableItems += 1; | ||
@@ -79,3 +99,3 @@ } else if (logoStackCount > 0 && logoStackCount < sizeList.length) { | ||
// console.log(`β ${osName} (${osCode}): ${sizeList.length - logoStackCount} logos missing (sizes: ${missingSizes.join(', ')})\n--------------------------`); | ||
console.log(`β ${osName} (${osCode}): ${sizeList.length - logoStackCount} logos missing (sizes: ${missingSizes.join(', ')})\n--------------------------`); | ||
} | ||
@@ -88,7 +108,15 @@ | ||
// console.log(`\n${totalStatistics}\n\n`); | ||
console.log(`\n${totalStatistics}\n\n`); | ||
updateList(`${totalStatistics}\n\n${tableMarkdown}`); | ||
if (slugList) { | ||
fs.writeFile('./os-list.json', JSON.stringify(slugList, null, 2), function (err) { | ||
if (err) throw err; | ||
console.log('slug-list.json updated!'); | ||
}); | ||
} | ||
} catch (err) { | ||
console.log(err.toString()); | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14417199
504
587
139
1