Security News
PyPI Introduces Digital Attestations to Strengthen Python Package Security
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
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 1,539,944 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.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.