{"_id":"macos-version","_rev":"4327221","name":"macos-version","description":"Get or check the current macOS version","dist-tags":{"latest":"6.0.0"},"maintainers":[{"name":"sindresorhus","email":""}],"time":{"modified":"2026-04-07T23:41:59.000Z","created":"2016-06-19T15:52:01.972Z","6.0.0":"2021-08-12T14:26:44.079Z","5.2.1":"2021-02-16T07:57:12.350Z","5.2.0":"2019-03-31T12:08:23.959Z","5.1.0":"2019-03-18T14:56:24.237Z","5.0.0":"2018-12-25T13:23:33.887Z","4.1.0":"2017-11-24T20:20:40.720Z","4.0.1":"2017-07-07T11:59:49.688Z","4.0.0":"2017-03-16T06:44:06.632Z","3.0.0":"2016-06-19T16:11:50.531Z","2.1.1":"2016-06-19T15:52:01.972Z"},"users":{},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"repository":{"type":"git","url":"git+https://github.com/sindresorhus/macos-version.git"},"versions":{"6.0.0":{"name":"macos-version","version":"6.0.0","description":"Get or check the current macOS version","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/macos-version.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"scripts":{"test":"xo && ava && tsd"},"keywords":["macos","os","darwin","operating","system","platform","version","release","semver","check","assert","condition"],"dependencies":{"semver":"^7.3.5"},"devDependencies":{"ava":"^3.15.0","tsd":"^0.17.0","xo":"^0.44.0"},"gitHead":"a091662e4ba2f67aab6f4ea5a5928fc803e97afa","bugs":{"url":"https://github.com/sindresorhus/macos-version/issues"},"homepage":"https://github.com/sindresorhus/macos-version#readme","_id":"macos-version@6.0.0","_nodeVersion":"12.22.1","_npmVersion":"7.10.0","dist":{"shasum":"86d901610895eb1252f132d846e92970b5d7d77c","size":2528,"noattachment":false,"key":"/macos-version/-/macos-version-6.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/macos-version/download/macos-version-6.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/macos-version_6.0.0_1628778403910_0.3880323849816414"},"_hasShrinkwrap":false,"publish_time":1628778404079,"_cnpm_publish_time":1628778404079,"_cnpmcore_publish_time":"2021-12-17T00:47:21.805Z"},"5.2.1":{"name":"macos-version","version":"5.2.1","description":"Get or check the current macOS version","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/macos-version.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"engines":{"node":">=6"},"scripts":{"test":"xo && ava && tsd"},"keywords":["macos","os","darwin","operating","system","platform","version","release","semver","check","assert","condition"],"dependencies":{"semver":"^5.6.0"},"devDependencies":{"ava":"^1.4.1","tsd":"^0.7.1","xo":"^0.24.0"},"gitHead":"a4d26018394a86ac1b09f7a6faa0b03498c2727e","bugs":{"url":"https://github.com/sindresorhus/macos-version/issues"},"homepage":"https://github.com/sindresorhus/macos-version#readme","_id":"macos-version@5.2.1","_nodeVersion":"14.15.1","_npmVersion":"6.14.10","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"056c943aac8edb81d7cafef6445b7ca1d7a2e56e","size":2560,"noattachment":false,"key":"/macos-version/-/macos-version-5.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/macos-version/download/macos-version-5.2.1.tgz"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/macos-version_5.2.1_1613462232233_0.25729447018696816"},"_hasShrinkwrap":false,"publish_time":1613462232350,"_cnpm_publish_time":1613462232350,"_cnpmcore_publish_time":"2021-12-17T00:47:22.076Z"},"5.2.0":{"name":"macos-version","version":"5.2.0","description":"Get or check the current macOS version","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/macos-version.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=6"},"scripts":{"test":"xo && ava && tsd"},"keywords":["macos","os","darwin","operating","system","platform","version","release","semver","check","assert","condition"],"dependencies":{"semver":"^5.6.0"},"devDependencies":{"ava":"^1.4.1","tsd":"^0.7.1","xo":"^0.24.0"},"gitHead":"874ad9062dab31437669107306753507407a0cc6","bugs":{"url":"https://github.com/sindresorhus/macos-version/issues"},"homepage":"https://github.com/sindresorhus/macos-version#readme","_id":"macos-version@5.2.0","_nodeVersion":"8.15.0","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"ae3a25155877902bbc5f5ae6b2d57b1ddce2e79e","size":2552,"noattachment":false,"key":"/macos-version/-/macos-version-5.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/macos-version/download/macos-version-5.2.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/macos-version_5.2.0_1554034103825_0.5835883684139411"},"_hasShrinkwrap":false,"publish_time":1554034103959,"_cnpm_publish_time":1554034103959,"_cnpmcore_publish_time":"2021-12-17T00:47:22.331Z"},"5.1.0":{"name":"macos-version","version":"5.1.0","description":"Get or check the current macOS version","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/macos-version.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=6"},"scripts":{"test":"xo && ava && tsd-check"},"keywords":["macos","os","darwin","operating","system","platform","version","release","semver","check","assert","condition"],"dependencies":{"semver":"^5.6.0"},"devDependencies":{"ava":"^1.3.1","tsd-check":"^0.5.0","xo":"^0.24.0"},"gitHead":"eb7781a5d806e9ea70113ef631d22cc38a060170","bugs":{"url":"https://github.com/sindresorhus/macos-version/issues"},"homepage":"https://github.com/sindresorhus/macos-version#readme","_id":"macos-version@5.1.0","_nodeVersion":"8.15.0","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"d3b5cac740a355b8baec8840f7d1f824d294c7b5","size":2530,"noattachment":false,"key":"/macos-version/-/macos-version-5.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/macos-version/download/macos-version-5.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/macos-version_5.1.0_1552920984091_0.2905970939518554"},"_hasShrinkwrap":false,"publish_time":1552920984237,"_cnpm_publish_time":1552920984237,"_cnpmcore_publish_time":"2021-12-17T00:47:22.599Z"},"5.0.0":{"name":"macos-version","version":"5.0.0","description":"Get or check the current macOS version","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/macos-version.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=6"},"scripts":{"test":"xo && ava"},"keywords":["macos","os","darwin","operating","system","platform","version","release","semver","check","assert","condition"],"dependencies":{"semver":"^5.3.0"},"devDependencies":{"ava":"^1.0.1","xo":"^0.23.0"},"gitHead":"229b5a413a83d9b180850f9b0e252ee83782a4f0","bugs":{"url":"https://github.com/sindresorhus/macos-version/issues"},"homepage":"https://github.com/sindresorhus/macos-version#readme","_id":"macos-version@5.0.0","_npmVersion":"6.4.1","_nodeVersion":"11.5.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"e7f6e7a5e7e0157f7249dbe2c5de3170a97ee0b6","size":2164,"noattachment":false,"key":"/macos-version/-/macos-version-5.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/macos-version/download/macos-version-5.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/macos-version_5.0.0_1545744213812_0.650977622443766"},"_hasShrinkwrap":false,"publish_time":1545744213887,"_cnpm_publish_time":1545744213887,"_cnpmcore_publish_time":"2021-12-17T00:47:22.811Z"},"4.1.0":{"name":"macos-version","version":"4.1.0","description":"Get or check the current macOS version","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/macos-version.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["macos","os","darwin","operating","system","platform","version","release","semver","check","assert","condition"],"dependencies":{"semver":"^5.3.0"},"devDependencies":{"ava":"*","xo":"*"},"gitHead":"e0a0e10e67325a4b5607f1c7c1fa9f273dbd77c5","bugs":{"url":"https://github.com/sindresorhus/macos-version/issues"},"homepage":"https://github.com/sindresorhus/macos-version#readme","_id":"macos-version@4.1.0","_shasum":"028e44adb28037e50395e2285bef054ef9b08ffa","_from":".","_npmVersion":"2.15.11","_nodeVersion":"4.8.4","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"028e44adb28037e50395e2285bef054ef9b08ffa","size":2169,"noattachment":false,"key":"/macos-version/-/macos-version-4.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/macos-version/download/macos-version-4.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/macos-version-4.1.0.tgz_1511554840538_0.41914063040167093"},"directories":{},"publish_time":1511554840720,"_hasShrinkwrap":false,"_cnpm_publish_time":1511554840720,"_cnpmcore_publish_time":"2021-12-17T00:47:23.227Z"},"4.0.1":{"name":"macos-version","version":"4.0.1","description":"Get or check the current macOS version","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/macos-version.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["macos","os","darwin","operating","system","platform","version","release","semver","check","assert","condition"],"dependencies":{"semver":"^5.3.0"},"devDependencies":{"ava":"*","xo":"*"},"gitHead":"e5a1796479f181b1f67755a32c56c858398dac8c","bugs":{"url":"https://github.com/sindresorhus/macos-version/issues"},"homepage":"https://github.com/sindresorhus/macos-version#readme","_id":"macos-version@4.0.1","_shasum":"ede40927e40ee0610cdb0f40bd94392d052e4fe5","_from":".","_npmVersion":"2.15.11","_nodeVersion":"4.8.3","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"ede40927e40ee0610cdb0f40bd94392d052e4fe5","size":2153,"noattachment":false,"key":"/macos-version/-/macos-version-4.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/macos-version/download/macos-version-4.0.1.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/macos-version-4.0.1.tgz_1499428788829_0.40902483300305903"},"directories":{},"publish_time":1499428789688,"_hasShrinkwrap":false,"_cnpm_publish_time":1499428789688,"_cnpmcore_publish_time":"2021-12-17T00:47:23.436Z"},"4.0.0":{"name":"macos-version","version":"4.0.0","description":"Get or check the current macOS version","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/macos-version.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["macos","os","darwin","operating","system","platform","version","release","semver","check","assert","condition"],"dependencies":{"semver":"^5.3.0"},"devDependencies":{"ava":"*","xo":"*"},"gitHead":"fc531434ad573c98bf871665fc6693469c9ba638","bugs":{"url":"https://github.com/sindresorhus/macos-version/issues"},"homepage":"https://github.com/sindresorhus/macos-version#readme","_id":"macos-version@4.0.0","_shasum":"5a1b8b55230529541ff714bc48e9b82225e265ec","_from":".","_npmVersion":"2.15.11","_nodeVersion":"4.7.3","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"5a1b8b55230529541ff714bc48e9b82225e265ec","size":2146,"noattachment":false,"key":"/macos-version/-/macos-version-4.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/macos-version/download/macos-version-4.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/macos-version-4.0.0.tgz_1489646646378_0.864700976992026"},"directories":{},"publish_time":1489646646632,"_hasShrinkwrap":false,"_cnpm_publish_time":1489646646632,"_cnpmcore_publish_time":"2021-12-17T00:47:23.647Z"},"3.0.0":{"name":"macos-version","version":"3.0.0","description":"Get the macOS version of the current system","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/macos-version.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["os","macos","osx","operating","system","platform","version"],"dependencies":{"execa":"^0.4.0"},"devDependencies":{"ava":"*","xo":"*"},"xo":{"esnext":true},"gitHead":"b4b4ccd561f62ee49278a82402b62850b50ad5fe","bugs":{"url":"https://github.com/sindresorhus/macos-version/issues"},"homepage":"https://github.com/sindresorhus/macos-version#readme","_id":"macos-version@3.0.0","_shasum":"4e25bc43d716f6d396a53f688a0c5ad9f1ae304d","_from":".","_npmVersion":"2.15.0","_nodeVersion":"4.4.2","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"4e25bc43d716f6d396a53f688a0c5ad9f1ae304d","size":1538,"noattachment":false,"key":"/macos-version/-/macos-version-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/macos-version/download/macos-version-3.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/macos-version-3.0.0.tgz_1466352709253_0.06768954521976411"},"directories":{},"publish_time":1466352710531,"_hasShrinkwrap":false,"_cnpm_publish_time":1466352710531,"_cnpmcore_publish_time":"2021-12-17T00:47:23.857Z"},"2.1.1":{"name":"macos-version","version":"2.1.1","description":"Get the macOS version of the current system","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/macos-version.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["os","macos","osx","operating","system","platform","version"],"dependencies":{"pify":"^2.2.0","pinkie-promise":"^2.0.0"},"devDependencies":{"ava":"*","xo":"*"},"gitHead":"6ddd1a560a56c7703db61a276694176b1076854c","bugs":{"url":"https://github.com/sindresorhus/macos-version/issues"},"homepage":"https://github.com/sindresorhus/macos-version#readme","_id":"macos-version@2.1.1","_shasum":"4f976320a4797ad0a05e3a62228a86522aa93861","_from":".","_npmVersion":"2.15.0","_nodeVersion":"4.4.2","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"4f976320a4797ad0a05e3a62228a86522aa93861","size":1618,"noattachment":false,"key":"/macos-version/-/macos-version-2.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/macos-version/download/macos-version-2.1.1.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/macos-version-2.1.1.tgz_1466351520758_0.48181922314688563"},"directories":{},"publish_time":1466351521972,"_hasShrinkwrap":false,"_cnpm_publish_time":1466351521972,"_cnpmcore_publish_time":"2021-12-17T00:47:24.053Z"}},"readme":"# macos-version\n\n> Get or check the current macOS version\n\n## Install\n\n```\n$ npm install macos-version\n```\n\n## Usage\n\n```js\nimport {\n\tmacOSVersion,\n\tisMacOSVersion,\n\tisMacOSVersionGreaterThanOrEqualTo,\n\tassertMacOSVersion,\n\tassertMacOSVersionGreaterThanOrEqualTo,\n\tassertMacOS,\n\tisMacOS,\n} from 'macos-version';\n\nmacOSVersion();\n//=> '10.12.3'\n\nisMacOSVersion('>10.10');\n//=> true\n\nisMacOSVersionGreaterThanOrEqualTo('10.10');\n//=> true\n\nassertMacOSVersion('>=10.12.5');\n//=> [Error: Requires macOS >=10.12.5]\n\nassertMacOSVersionGreaterThanOrEqualTo('10.12.5');\n//=> [Error: Requires macOS 10.12.5 or later]\n\nassertMacOS();\n//=> [Error: Requires macOS]\n\nif (isMacOS) {\n\tconsole.log('macOS');\n}\n```\n\n## API\n\n### macOSVersion()\n\nReturns the macOS version or `undefined` if the platform is not macOS.\n\n### isMacOSVersion(semverRange)\n\nReturns a `boolean` of whether the specified [semver range](https://github.com/npm/node-semver#ranges) matches the macOS version.\n\n### isMacOSVersionGreaterThanOrEqualTo(version)\n\nReturns a `boolean` of whether the macOS version is greater than or equal to the specified version.\n\n### assertMacOSVersion(semverRange)\n\nThrows an error if the specified [semver range](https://github.com/npm/node-semver#ranges) does not match the macOS version.\n\n### assertMacOSVersionGreaterThanOrEqualTo(version)\n\nThrows an error if the macOS version is not greater than or equal to the specified version.\n\n*Prefer this over `.assert()` whenever possible as it outputs a more user-friendly error message.*\n\n### assertMacOS()\n\nThrows an error if the platform is not macOS.\n\n### isMacOS\n\nType: `boolean`\n\nWhether the platform is macOS.\n\n## Related\n\n- [macos-version-cli](https://github.com/sindresorhus/macos-version-cli) - CLI for this module\n- [macos-release](https://github.com/sindresorhus/macos-release) - Get the name and version of a macOS release from the Darwin version\n","_attachments":{},"homepage":"https://github.com/sindresorhus/macos-version#readme","bugs":{"url":"https://github.com/sindresorhus/macos-version/issues"},"license":"MIT"}