get-startapps
v2.0.2
Published
Wrapper for the PowerShell Get-StartApps command.
Downloads
30
Maintainers
Readme
About
Wrapper for the PowerShell Get-StartApps command.
Examples
Get every apps:
import getapps, { isValidAUMID } from "get-startapps";
const apps = await getapps();
/* OUTPUT
[
{
name: '...',
appID: '...'
},
...
]
*/
//Keep only UWP apps
const UWP = apps.filter(app => isValidAUMID(app.appID))
Search:
import getapps from "get-startapps";
await getapps("Xbox");
await getapps({name: "Xbox"}); //search by name only
await getapps({appID: "Xbox"}); //search by appID only
await getapps({name: "Xbox", appID:"GamingOverlay"}) //search by name and appID
Has GamingOverlay (Microsoft.XboxGamingOverlay_8wekyb3d8bbwe!App) ? :
import { has } from "get-startapps";
has({id:"GamingOverlay"}) //true or false
Is "Microsoft.WindowsStore_8wekyb3d8bbwe!App" a valid UWP Application User Model ID ?
import { isValidAUMID } from "get-startapps";
isValidAUMID("Microsoft.WindowsStore_8wekyb3d8bbwe!App")); //true
Installation
npm install get-startapps
API
⚠️ This module is only available as an ECMAScript module (ESM) starting with version 2.0.0. Previous version(s) are CommonJS (CJS) with an ESM wrapper.
Default export
(search?: string | object): Promise<obj[]>
Invok Get-StartApps with an optional search.
if search
is
- a string this is eq to
Get-StartApps %search%
- an object
{name?: string, appID?: string}
then search for either matching name, appid or both. - omitted/empty object this is eq to
Get-StartApps
and it will list all available apps.
Returns an array of object :
[{
name: string,
appID: string
}]
Example:
import getapps from "get-startapps";
await getapps("Xbox");
await getapps({name:"Game Bar",id:"GamingOverlay"}); //both properties
await getapps({name:"Microsoft"}); //by name only
await getapps({id:"Xbox"}); //by id only
await getapps(); //list all
Named export
has(search: string | object): Promise<boolean>
Like default export but return a boolean if found or not. A valid search paramater (not empty) is required.
Example:
import { has } from "get-startapps";
await has("Xbox");
await has({id:"GamingOverlay", name: "Game Bar"}); //both properties
await has({id:"GamingOverlay"}); //by name only
await has({name:"Game Bar"}); //by id only
isValidAUMID(appID: string): boolean
Check if appID is a valid UWP Application User Model ID.
Example:
import { isValidAUMID } from "get-startapps";
isValidAUMID("Microsoft.WindowsStore_8wekyb3d8bbwe!App")); //true
isValidAUMID("com.squirrel.GitHubDesktop.GitHubDesktop")); //false