0.0.7 • Published 5 years ago

@vimlet/commons-os v0.0.7

Weekly downloads
54
License
MIT
Repository
github
Last release
5 years ago

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:
  1. 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:
  1. 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.