Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

macos-version

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

macos-version

Get or check the current macOS version

  • 4.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
9.9K
decreased by-6.44%
Maintainers
1
Weekly downloads
 
Created
Source

macos-version Build Status

Get or check the current macOS version

Install

$ npm install --save macos-version

Usage

const macosVersion = require('macos-version');

macosVersion();
//=> '10.12.3'

macosVersion.is('>10.10');
//=> true

macosVersion.assertGreaterThanOrEqualTo('10.12.5');
//=> [Error: Requires macOS 10.12.5 or later]

API

macosVersion()

Returns the macOS version.

macosVersion.is(semverRange)

Returns a boolean of whether the specified semver range matches the macOS version.

macosVersion.isGreaterThanOrEqualTo(version)

Returns a boolean of whether the macOS version is greater than or equal to the specified version.

macosVersion.assert(semverRange)

Throws an error if the specified semver range does not match the macOS version.

macosVersion.assertGreaterThanOrEqualTo(version)

Throws an error if the macOS version is not greater than or equal to the specified version.

Prefer this over .assert() whenever possible as it outputs a more user-friendly error message.

assertMacOS()

Throws an error if platform is not macOS.

.isMacOS

True if platform is macOS.

  • macos-version-cli - CLI for this module
  • macos-release - Get the name and version of a macOS release from the Darwin version

License

MIT © Sindre Sorhus

Keywords

FAQs

Package last updated on 24 Nov 2017

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc