windows-release
Advanced tools
Comparing version 4.0.0 to 5.0.0
@@ -10,4 +10,4 @@ /** | ||
``` | ||
import * as os from 'os'; | ||
import windowsRelease = require('windows-release'); | ||
import os from 'node:os'; | ||
import windowsRelease from 'windows-release'; | ||
@@ -29,4 +29,2 @@ // On a Windows XP system | ||
*/ | ||
declare function windowsRelease(release?: string): string; | ||
export = windowsRelease; | ||
export default function windowsRelease(release?: string): string; |
16
index.js
@@ -1,7 +0,7 @@ | ||
'use strict'; | ||
const os = require('os'); | ||
const execa = require('execa'); | ||
import os from 'node:os'; | ||
import execa from 'execa'; | ||
// Reference: https://www.gaijin.at/en/lstwinver.php | ||
const names = new Map([ | ||
['11.0', '11'], | ||
['10.0', '10'], | ||
@@ -17,6 +17,6 @@ ['6.3', '8.1'], | ||
['4.1', '98'], | ||
['4.0', '95'] | ||
['4.0', '95'], | ||
]); | ||
const windowsRelease = release => { | ||
export default function windowsRelease(release) { | ||
const version = /\d+\.\d/.exec(release || os.release()); | ||
@@ -33,3 +33,3 @@ | ||
// then use `wmic` to get the OS caption: https://msdn.microsoft.com/en-us/library/aa394531(v=vs.85).aspx | ||
// If `wmic` is obsoloete (later versions of Windows 10), use PowerShell instead. | ||
// If `wmic` is obsolete (later versions of Windows 10), use PowerShell instead. | ||
// If the resulting caption contains the year 2008, 2012, 2016 or 2019, it is a server version, so return a server OS name. | ||
@@ -52,4 +52,2 @@ if ((!release || release === os.release()) && ['6.1', '6.2', '6.3', '10.0'].includes(ver)) { | ||
return names.get(ver); | ||
}; | ||
module.exports = windowsRelease; | ||
} |
{ | ||
"name": "windows-release", | ||
"version": "4.0.0", | ||
"version": "5.0.0", | ||
"description": "Get the name of a Windows version from the release number: `5.1.2600` → `XP`", | ||
@@ -13,4 +13,6 @@ "license": "MIT", | ||
}, | ||
"type": "module", | ||
"exports": "./index.js", | ||
"engines": { | ||
"node": ">=10" | ||
"node": "^12.20.0 || ^14.13.1 || >=16.0.0" | ||
}, | ||
@@ -38,9 +40,9 @@ "scripts": { | ||
"dependencies": { | ||
"execa": "^4.0.2" | ||
"execa": "^5.1.1" | ||
}, | ||
"devDependencies": { | ||
"ava": "^2.4.0", | ||
"tsd": "^0.13.1", | ||
"xo": "^0.33.0" | ||
"ava": "^3.15.0", | ||
"tsd": "^0.17.0", | ||
"xo": "^0.44.0" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
# windows-release [![Build Status](https://travis-ci.com/sindresorhus/windows-release.svg?branch=master)](https://travis-ci.com/github/sindresorhus/windows-release) | ||
# windows-release | ||
@@ -14,4 +14,4 @@ > Get the name of a Windows version from the release number: `5.1.2600` → `XP` | ||
```js | ||
const os = require('os'); | ||
const windowsRelease = require('windows-release'); | ||
import os from 'node:os'; | ||
import windowsRelease from 'windows-release'; | ||
@@ -18,0 +18,0 @@ // On a Windows XP system |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Yes
5990
62
+ Addedexeca@5.1.1(transitive)
+ Addedget-stream@6.0.1(transitive)
+ Addedhuman-signals@2.1.0(transitive)
- Removedend-of-stream@1.4.4(transitive)
- Removedexeca@4.1.0(transitive)
- Removedget-stream@5.2.0(transitive)
- Removedhuman-signals@1.1.1(transitive)
- Removedonce@1.4.0(transitive)
- Removedpump@3.0.2(transitive)
- Removedwrappy@1.0.2(transitive)
Updatedexeca@^5.1.1