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

windows-release

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

windows-release - npm Package Compare versions

Comparing version 4.0.0 to 5.0.0

8

index.d.ts

@@ -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;

@@ -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

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