Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
macos-release
Advanced tools
The macos-release npm package is used to get the macOS name and version from the Darwin version. It is useful for applications that need to display or log the macOS version in a human-readable format.
Get macOS release name and version
This feature allows you to get the macOS release name and version. The code sample demonstrates how to use the macos-release package to get the current macOS release information and log it to the console.
const macosRelease = require('macos-release');
const release = macosRelease();
console.log(release);
Get macOS release name and version from a specific Darwin version
This feature allows you to get the macOS release name and version from a specific Darwin version. The code sample demonstrates how to use the macos-release package to get the macOS release information for Darwin version '20.3.0' and log it to the console.
const macosRelease = require('macos-release');
const release = macosRelease('20.3.0');
console.log(release);
The os-name package provides the name of the operating system. It supports multiple platforms including macOS, Windows, and Linux. Compared to macos-release, os-name is more versatile as it can be used across different operating systems, but it may not provide as detailed information specifically for macOS.
The os-release package is used to get the operating system release information. It is similar to macos-release but is more general-purpose and can be used on various Unix-like operating systems. It may not provide the specific macOS release names but is useful for broader OS detection.
Get the name and version of a macOS release from the Darwin version
Example:13.2.0
→{name: 'Mavericks', version: '10.9'}
$ npm install --save macos-release
const os = require('os');
const macosRelease = require('macos-release');
// on a macOS Sierra system
macosRelease();
//=> {name: 'Sierra', version: '10.12'}
os.release();
//=> 13.2.0
// this is the Darwin kernel version
macosRelease(os.release());
//=> {name: 'Sierra', version: '10.12'}
macosRelease('14.0.0');
//=> {name: 'Yosemite', version: '10.10'}
Type: string
By default the current operating system is used, but you can supply a custom Darwin kernel version, which is the output of os.release()
.
macOS Sierra
10.9.3
5.1.2600
→ XP
MIT © Sindre Sorhus
FAQs
Get the name and version of a macOS release from the Darwin version
The npm package macos-release receives a total of 2,551,169 weekly downloads. As such, macos-release popularity was classified as popular.
We found that macos-release demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.