https://github.com/xpodev/winreg-promise
A promise-based wrapper around the winreg package
https://github.com/xpodev/winreg-promise
nodejs promise windows-registry winreg
Last synced: 5 months ago
JSON representation
A promise-based wrapper around the winreg package
- Host: GitHub
- URL: https://github.com/xpodev/winreg-promise
- Owner: xpodev
- License: other
- Created: 2024-09-28T00:49:16.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-09-28T03:30:09.000Z (over 1 year ago)
- Last Synced: 2025-09-23T04:41:42.158Z (9 months ago)
- Topics: nodejs, promise, windows-registry, winreg
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/winreg-promise
- Size: 23.4 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# winreg-promise
A promise-based wrapper around the [winreg](https://www.npmjs.com/package/winreg) package.
This package omits the callback-based API of the original package in favor of promises.
The values returned by the promise-based API is the same as the callback-based API except that the error is thrown instead of being passed to the callback.
## Installation
```bash
npm install winreg-promise
```
## Usage
```javascript
const Registry = require('winreg-promise');
const regKey = new Registry({
hive: winreg.HKCU,
key: '\\Software\\Microsoft\\Windows\\CurrentVersion\\Run'
});
async function get() {
try {
const value = await regKey.get('MyApp');
console.log(value);
} catch (err) {
console.error(err);
}
}
async function set() {
try {
await regKey.set('MyApp', winreg.REG_SZ, 'C:\\path\\to\\myapp.exe');
} catch (err) {
console.error(err);
}
}
```
## License
- This repository contains code under both the MIT License and the BSD 2-Clause License.
- The original code by Paul Bottin is licensed under the BSD 2-Clause License.
- All other code is licensed under the MIT License.
See [LICENSE](LICENSE) for details.