Repository URL to install this package:
Version:
1.9.1-1486597190 ▾
|
.. |
lib |
package.json |
winreg-0.0.13.tgz |
README.md |
test.js |
node module that provides access to the Windows Registry through the REG commandline tool
npm install winreg
Let's start with an example. The code below lists the autostart programs of the current user.
var Winreg = require('winreg') , regKey = new Winreg({ hive: Winreg.HKCU, // HKEY_CURRENT_USER key: '\\Software\\Microsoft\\Windows\\CurrentVersion\\Run' // key containing autostart programs }) // list autostart programs regKey.values(function (err, items) { if (err) console.log('ERROR: '+err); else for (var i in items) console.log('ITEM: '+items[i].name+'\t'+items[i].type+'\t'+items[i].value); });
The following options are processed by the Winreg constructor:
The key, if specified, has to start, but must not be terminated with a '\' character.
The instances of Winreg provide access to a single registry key. The hive id can be one of the following:
Registry values are returned as objects, containing the following information:
Registry values can have one of the following types:
Following methods are provided by instances of Winreg:
Following readonly properties are provided by instances of Winreg: