A very simple, and incomplete registry editor for Node.js.
These functions are enough for me. Need more? Create issue!
$ npm install --save regedit-simple
var regedit = require('regedit-simple');
// simplifed version
regedit.addKey({
target: 'HKCU\\Software\\TestDemo',
name: 'MyApp',
value: 'heyLookAValue',
type: 'REG_SZ'
}).then(function(result) {
console.log(result);
// get own data
regedit.getKey({
target: 'HKCU\\Software\\TestDemo'
}).then(function(result) {
console.log(result);
// destroy own data
regedit.delete({
target: 'HKCU\\Software\\TestDemo'
}).then(function(result) {
console.log(result);
})
})
})
Include in your project
var regedit = require('regedit-simple');
Get at what is contained in a particular Registry key(target)
regedit.query('HKEY_CURRENT_USER\\Software\\7-Zip').then(funciton(data){
//example data
data={
ths: 'HKEY_CURRENT_USER\\Software\\7-Zip',
values:
{
Path64: 'C:\\Program Files\\7-Zip\\',
Path: 'C:\\Program Files\\7-Zip\\'
},
valuesTypes: {
Path64: 'REG_SZ',
Path: 'REG_SZ'
},
childsList: [
'HKEY_CURRENT_USER\\Software\\7-Zip\\FM'
],
childsListAbs: ['FM']
}
});
Aliases: regedit.query, regedit.getKey
Add keys and values to the Registry
regedit.addKey({
target:'string',
name:'string', // Adds or changes a value
type:'string', // The type of value: REG_BINARY, REG_DWORD, REG_SZ, REG_MULTI_SZ, etc. The default is REG_SZ
value:'string' // The data to assign to a value
});
Aliases: regedit.add
Delete keys and values to the Registry
regedit.delete({
target:'string',
name:'string' or 'don`t set(undefined)', // Deletes a value
del_default:bool or 'don`t set(undefined)', // Deletes a key's default value
del_all:bool or 'don`t set(undefined)' // Deletes all values from a key
});
Aliases: regedit.del
- If name is specified, it will return the single value (or a message indicating none is available).
- Testing
- Support specified names