2.2.1 • Published 2 years ago

windows-packages v2.2.1

Weekly downloads
4
License
MIT
Repository
github
Last release
2 years ago

A Node.js module for reading the Packages registry key on Windows 10. Useful for retrieving applications installed from the Microsoft Store.

✨Since v.2.1.0 Windows Packages is a hybrid module that supports both CommonJS (legacy) and ES modules, thanks to Modern Module.

Install

npm install windows-packages --save

Exports

  • Functions

    • get(),
    • has().

Usage

get(): string[]

Returns an array of sub-keys located in the WindowsPackages key.

import * as winPkgs from 'windows-packages'
const packages = winPkgs.get()

console.log(packages) // ['Microsoft.MicrosoftEdge_44.18362.267.0...', 'Microsoft.Microsoft3DViewer_7.1908.9012.0...',...]

// names shortened for the sake of brevity
has(list: string[]): boolean[]

Returns an array of Booleans indicating whether the entries of the parameter list are installed on the system.

import * as winPkgs from 'windows-packages'
const has = winPkgs.has(['edge', 'foobar', 'mspaint'])

console.log(has) // [true, false, true]

Development

git clone https://github.com/igorskyflyer/npm-windows-packages.git

followed by a,

npm install

Test

Open the project and execute:

npm i
npm test