@nodevisor/os
v0.0.83
Published
Module provides operating system-related utility methods and properties
Downloads
419
Readme
@nodevisor/os
Cross-platform operating system detection and system commands.
Part of Nodevisor — TypeScript Infrastructure Automation Platform
Install
npm install @nodevisor/osQuick Start
import $ from '@nodevisor/shell';
import OS from '@nodevisor/os';
const os = $(OS);
const hostname = await os.hostname();
const arch = await os.arch();
const uptime = await os.uptime();
const hasDocker = await os.commandExists('docker');Remote Usage
const $server = $.connect({ host: '10.0.0.10', username: 'root' });
const hostname = await $server(OS).hostname();API
| Method | Description |
|--------|-------------|
| hostname() | Get the system hostname |
| arch() | Get the CPU architecture (x64, arm64, etc.) |
| uptime() | Get system uptime in seconds |
| commandExists(cmd) | Check if a command is available on the system PATH |
| reboot() | Reboot the system (cross-platform) |
| shutdown() | Shutdown the system (cross-platform) |
Related Packages
@nodevisor/shell— Core shell execution@nodevisor/packages— Package manager abstraction (uses OS for detection)@nodevisor/pwsh— PowerShell wrapper (used internally for Windows)
Documentation
Full documentation available at nodevisor.com/docs/packages/os
License
Nodevisor uses a single O'Saasy license across all packages and applications. See the full terms in LICENSE.
