Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
win-release
Advanced tools
Get the name of a Windows version from the release number: `5.1.2600` → `XP`
The win-release npm package is used to get the name of a Windows version from the release number. This can be useful for applications that need to display or log the Windows version in a human-readable format.
Get Windows version name from release number
This feature allows you to get the Windows version name from a given release number. In this example, the release number '10.0.19041' corresponds to Windows 10.
const winRelease = require('win-release');
console.log(winRelease('10.0.19041')); // '10'
The os-name package provides a more general solution for getting the name of the operating system, including Windows, macOS, and Linux. It is more versatile compared to win-release, which is specific to Windows.
The os-release package is another alternative that provides information about the operating system release. It is similar to win-release but offers more detailed information and supports multiple operating systems.
Get the name of a Windows version from the release number:
5.1.2600
→XP
$ npm install win-release
const os = require('os');
const winRelease = require('win-release');
// On a Windows XP system
winRelease();
//=> 'XP'
os.release();
//=> '5.1.2600'
winRelease(os.release());
//=> 'XP'
winRelease('4.9.3000');
//=> 'ME'
Type: string
By default, the current OS is used, but you can supply a custom release number, which is the output of os.release()
.
Note: Most Windows Server versions cannot be detected based on the release number alone. There is runtime detection in place to work around this, but it will only be used if no argument is supplied, or the supplied argument matches os.release()
.
MIT © Sindre Sorhus
FAQs
Get the name of a Windows version from the release number: `5.1.2600` → `XP`
We found that win-release demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.