Package Exports
- @vimlet/commons-os
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@vimlet/commons-os) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
OS
Operating system tools.
Installation
npm install @vimlet/commons-os
It will be also installed as a module within @vimlet/commons
Usage
os.isWindows()
os.isLinux()
os.isMac()
os.is64Bit()
os.getUnixUserProfile()
os.setUserEnvironmentVariable(key, value, callback)
Sets environment variables without admin privileges.
- key: Enviroment variable key.
- value: Enviroment variable value.
- callback
os.addToUserPath(value, callback)
Sets path variables without admin privileges.
- value: Path value to append.
- callback
os.killProcessByName(name, options, callback)
Kill a process by its name.
- name: Name of the process to be killed.
- options:
- execHandler: Default output callback `function(out), >redirects stdout when provided.
- callback
os.createSymlink(dest, src, options, callback)
Creates a symbolic link without admin privileges.
- dest: Symlink destination path.
- src: Symlink source path.
- options:
- execHandler: Default output callback
function(out), >redirects stdout when provided.
- callback
os.findExec(binary, callback)
Asserts if a command is accessible from the command line.
- binary: Symlink destination path.
- callback
License
This project is under MIT License. See LICENSE for details.