import os from "os";

export function getDeviceInfo() {
  return {
    os: {
      platform: os.platform(),
      type: os.type(),
      release: os.release(),
      arch: os.arch(),
      hostname: os.hostname(),
    },
    cpu: {
      cores: os.cpus().length,
      model: os.cpus()[0].model,
      speedMHz: os.cpus()[0].speed,
    },
    user: os.userInfo(),
    process: {
      nodeVersion: process.version,
      execPath: process.execPath,
    },
  };
}
