regedit-helper
v1.0.3
Published
A simple tool to help handle the registry
Downloads
1
Readme
RegEditHelper
A simple tool to help handle the registry
Example
const RegistryHelper = require('regedit-helper').default;
const helper = RegistryHelper.new('HKCU\\Software\\HMS')
helper.query('Test2020').values().then(r=>{
console.log(r);
})
here's the result:
{
"Test2020": {
"name": "admin",
"age" : "22"
}
}
API
static
RegeditHelper new(namespace)
get a Instance of RegeditHelpernamespace
#string
: the registry keyPath, the curd keyPath will relative to itstatic
boolean create(keyPath)
create a registry key path if not existskeyPath
#string
: the registry full keyPathboolean insert(valueObject, keyPath = '')
to insert value to the registryvalues
#object
: a simple js object, and it contains object types, which contains propertiestype
,value
const valueObject = { name:{ type:'REG_SZ', value:'admin' } }
keyPath
#string
: the registry keyPath relative to its namespaceboolean insertValues(values, keyPath = '', type = RegeditHelper.REG_SZ)
to insert value to the registryvalues
#object
: a simple js object, and it contains only primitive typesconst values = { name: 'REG_SZ', age: 22, }
keyPath
#string
: the registry keyPath relative to its namespacetype
#string
: the registry type, defaultREG_SZ
boolean update(values, keyPath = '', type= RegeditHelper.REG_SZ)
update value to the registry, its parameter the same toinsertValues
boolean remove(keys: string | string[] = [], values: string | string[] = [])
remove the registry keykeyPath
#string|string[]
: the registry keyPath relative to its namespace, default[]
values
#string|string[]
: the registry leaf keys, default[]
When only the first parameter is passed, the current key and all its child node key values will be removed. The second parameter is used to control the specific attribute key value of the current node
this query(keyPath = '', type = '', rec = true)
query values from the registrykeyPath
#string
: the registry keyPath relative to its namespace, default''
type
#string
: the registry type, defaultREG_SZ
rec
#boolean
: is recursive query required, defaulttrue
Promise<object> origin()
get query origin resultsPromise<object> values()
get query values resultsPromise<object> one()
only get the data of the keyPath, not include its children nodes