Node Utilities for Windows
Right now it's just a few wrappers around some builtin console commands but FFI bindings are soon to come.
Command line tools
Some wrappers for the below APIs to be used on the command line.
cwddrive alias a random available drive letter to current working directory
cwddrive L alias L to CWD if not taken, or toggles it off if it currently is L
cwddrive L C:/some/folder alias L to C:/some/folder if available
makerunnable f1.js [f2.js] ... creates a .cmd file in npm.globalBin (is in PATH) that will exec the .js
APIs
driveAlias('x', folder)
driveAlias('x')
driveAlias()
runnable(['myCLI.js',...],function(r){
'NPMGLOBALBIN/myCLI.cmd created'
'Could not find myCLI.js'
});
associations('.js'. 'jscript')
associations('.js')
associations()
fileTypes('jscript'. process.execPath)
fileTypes('jscript')
fileTypes()
getFontNames()
findWindowsSDK()
{ path: winSDKfolder,
versions: [8, 9, 10] }
registry(key, options)
v = registry('HKLM/Software/Microsoft'
v.someValue.remove()
v.add('newValue', 'myValue')
v.add('newKey')
v.subKey
x = registry('HKCU/Some/Random/Place')
x.add('newName', v.someValue)
z = v.aValue
z.remove()
v.add(z.name, z)
v.remove()
v.remove('name')
options = { search : 'query',
recursive : false,
case : false,
exact : false,
in : 'keys' || 'values',
type : 'REG_SZ' || 'REG_MULTI_SZ' || 'REG_DWORD' ||
'REG_BINARY' || 'REG_EXPAND_SZ' || 'REG_QWORD' ||
'REG_NONE' }
registry.query
registry.add
registry.delete
registry.copy
registry.save
registry.restore
registry.load
registry.unload
registry.compare
registry.export
registry.import
registry.flags
execSync('cmd' ...)
Command(command, name, formatter)
function parseCSV(str){
return str.trim().split(/\r?\n/).map(function(str){
return JSON.parse('['+str+']');
});
return str;
}
var nodes = Command('tasklist /fo csv /fi "imagename eq node.exe"', 'nodes', parseCSV);
nodes();