@igorskyflyer/registry-apppaths
v1.1.0
Published
๐ช A package for reading the AppPaths registry key on Windows. Useful for retrieving applications that can be launched from the command prompt. ๐
Maintainers
Readme
๐ CAUTION
WINDOWS ONLY
This package uses
reg.exeunder the hood, thus, only works on Windows OS.
๐ Table of Contents
๐ค Features
- โก Instant results - reads Windows App Paths registry keys synchronously
- ๐ Full list retrieval - grab all registered app paths in one call
- ๐ง Smart caching - avoids repeated registry lookups for faster performance
- ๐ Force refresh - bypass cache when you need the latest data
- ๐ Key presence check - verify if specific apps are registered
- ๐ Case sensitivity option - match keys exactly or loosely
- ๐งน Cache clear - reset stored results anytime
- ๐ป Windows-only - throws error if run on nonโWindows systems
๐ต๐ผ Usage
Install it by executing any of the following, depending on your preferred package manager:
pnpm add @igorskyflyer/registry-apppathsyarn add @igorskyflyer/registry-apppathsnpm i @igorskyflyer/registry-apppaths๐คน๐ผ API
getAppPaths(): string[]
Returns an array of sub-keys located in the AppPaths key.
import { getAppPaths } from '@igorskyflyer/registry-apppaths'
const apps: string[] = getAppPaths()
console.log(apps) // ['chrome.exe', 'firefox.exe', 'opera.exe'...]hasAppPaths(list: string[]): boolean[]
Returns an array of Booleans indicating whether the entries of the parameter list are installed on the system.
import { hasAppPaths } from '@igorskyflyer/registry-apppaths'
const has: boolean[] = hasAppPaths(['chrome.exe', 'winword.exe', 'mspaintTYPO.exe'])
console.log(has) // [true, true, false]refreshAppPaths(): void
Force refresh the info from the registry, instead of retrieving the cached data.
import { getAppPaths, refreshAppPaths } from '@igorskyflyer/registry-apppaths'
let apps: string[] = getAppPaths()
console.log(apps) // ['chrome.exe', 'firefox.exe', 'opera.exe'...]
// application install...
// we installed Word for example
refreshAppPaths()
apps = getAppPaths()
console.log(apps) // ['chrome.exe', 'firefox.exe', 'opera.exe', 'winword.exe'...]๐ Changelog
๐ The changelog is available here, CHANGELOG.md.
๐ชช License
Licensed under the MIT license which is available here, MIT license.
๐ Support
๐งฌ Related
๐งฒ Provides ways of properly checking if a path exists inside a given array of files/directories both on Windows and UNIX-like operating systems. ๐บ
๐งฐ Provides ways of testing whether a given value can be a valid file/directory name. ๐
๐ฅฝ Provides ways of parsing UNC paths and checking whether they are valid. ๐ฑ
@igorskyflyer/extendable-string
๐ฆ ExtendableString allows you to create strings on steroids that have custom transformations applied to them, unlike common, plain strings. ๐ช
๐งฎ Calculates an estimated file size of Mp3 files. ๐ถ
๐จ๐ปโ๐ป Author
Created by Igor Dimitrijeviฤ (@igorskyflyer).
