Node Env
nodejs platform for various-devices
getOs
platform Nodejs
usage
js
import { getOs } from 'various-devices'
getOs().then(res=> {
console.log(res)
})
getos is an asynchronous function. It will return an object. The following are the properties of the specific object.
ts
interface noedOS {
name: string
version: string
platform: string
arch: string
cpuModel: string
cpuSpeed: number
cpus: number
totalMemory: string
freeMemory: string
}
params
- name string platform name (操作系统名称)
- version string platform version (操作系统版本)
- platform string platform (操作系统平台)
- arch string arch (操作系统架构)
- cpuModel string cpu model (cpu型号)
- cpuSpeed number cpu speed (cpu速度)
- cpus number cpus (cpu数量)
- totalMemory string total memory (总内存)
- freeMemory string free memory (空闲内存)
getPlatformNode
platform Nodejs
usage
js
import { getPlatformNode } from 'various-devices'
getPlatformNode()
getPlatformNode This API is used to obtain the properties related to the node environment.
ts
export interface Result {
platform:'node';
version?:string;
}
params
- platform string platform (node环境)
- version string version (node版本)
Contributors
xiaoMan 💻 📖 🎨 | yanzibiezou 💻 | 徐轲 💻 | yinxing233 💻 | |||