Methods
arch()
Get the CPU architecture of the current process.Returns the architecture:
arm, arm64, ia32, x64, mips, ppc, or ppc64platform()
Get the operating system platform.Returns the platform:
darwin (macOS), win32 (Windows), or linuxuptime()
Get the number of seconds the process has been running.Returns the uptime in seconds
fresh()
Get fresh process information as an object.Returns an object with all process properties
Complete Examples
Platform Detection
Architecture-Specific Features
Uptime Monitoring
Combined Process Information
Platform-Specific Paths
Platform Values
Theplatform() method returns one of these values:
- darwin - macOS
- win32 - Windows (both 32-bit and 64-bit)
- linux - Linux
Architecture Values
Thearch() method returns one of these values:
- x64 - 64-bit Intel/AMD
- arm64 - 64-bit ARM (Apple Silicon, etc.)
- ia32 - 32-bit Intel/AMD
- arm - 32-bit ARM
- mips - MIPS architecture
- ppc - PowerPC
- ppc64 - 64-bit PowerPC
Use Cases
Platform Detection
Detect the operating system to show platform-specific UI or features
Architecture Checks
Optimize code paths based on CPU architecture (ARM vs x64)
Uptime Tracking
Monitor how long the app has been running for analytics or warnings
Path Resolution
Determine correct file paths for different platforms
The Process API provides runtime information about the Electron process, not the PHP process. This is useful for platform detection and architecture-specific optimizations.