steam-sysreq
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -1,7 +0,1 @@ | ||
declare const formattedOsNames: Record<string, string>; | ||
declare const sizes: string[]; | ||
declare const base: number; | ||
declare function formatBytes(bytes: number): string; | ||
interface SystemRequirements { | ||
@@ -8,0 +2,0 @@ os: string; |
17
index.js
@@ -0,1 +1,3 @@ | ||
'use strict'; | ||
import { osInfo, cpu, mem, graphics, fsSize } from 'systeminformation'; | ||
@@ -14,3 +16,3 @@ | ||
sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'], | ||
base = 1024; | ||
logBase = Math.log(1024); | ||
@@ -23,8 +25,5 @@ /** | ||
function formatBytes(bytes) { | ||
if (typeof bytes !== 'number' || isNaN(bytes)) | ||
throw new TypeError("Argument 'bytes' must be a number."); | ||
const exponent = Math.floor(Math.log(bytes) / logBase); | ||
const exponent = Math.floor(Math.log(bytes) / Math.log(base)); | ||
return `${(bytes / Math.pow(base, exponent)).toFixed()} ${sizes[exponent]}`; | ||
return `${(bytes / Math.pow(1024, exponent)).toFixed()} ${sizes[exponent]}`; | ||
} | ||
@@ -55,5 +54,5 @@ | ||
return { | ||
os: `${formattedOsNames[osInfo_.platform] ?? osInfo_.platform} ${osInfo_.kernel} (${ | ||
osInfo_.distro | ||
} ${osInfo_.release})`, | ||
os: `${formattedOsNames[osInfo_.platform] ?? osInfo_.platform} ${ | ||
osInfo_.kernel | ||
} (${osInfo_.distro} ${osInfo_.release})`, | ||
processor: `${cpu_.manufacturer} ${cpu_.brand} @ ${cpu_.speedMax.toFixed( | ||
@@ -60,0 +59,0 @@ 2 |
{ | ||
"name": "steam-sysreq", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Gets system requirement information to compare to the ones shown in Steam.", | ||
@@ -11,8 +11,19 @@ "main": "index.js", | ||
}, | ||
"keywords": [], | ||
"keywords": [ | ||
"steam", | ||
"version" | ||
], | ||
"author": "Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>", | ||
"license": "ISC", | ||
"license": "MIT", | ||
"dependencies": { | ||
"systeminformation": "^5.11.9" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/VoltrexMaster/steam-sysreq/issues" | ||
}, | ||
"homepage": "https://github.com/VoltrexMaster/steam-sysreq", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/VoltrexMaster/steam-sysreq" | ||
} | ||
} |
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
4745
0
0
1
0
83