@remote.it/core
Version:
Core remote.it JavasScript/TypeScript library
20 lines (15 loc) • 512 B
text/typescript
import { machineIdSync } from 'node-machine-id'
// TODO: Maybe move to Environment class?
export class SystemID {
static get id() {
// Mac:
// ioreg -rd1 -c IOPlatformExpertDevice | awk '/IOPlatformUUID/ { split($0, line, "\""); printf("%s\n", line[4]); }'
// Windows:
// wmic csproduct get UUID
// Linux:
// blkid | grep -oP 'UUID="\K[^"]+'
// machine-id # http://man7.org/linux/man-pages/man5/machine-id.5.html
// RPi: cat /etc/machine-id
return machineIdSync()
}
}