Nodejs OS模块

简介: nodejs学习笔记
varos=require("os");
// CPU的字节序,可能的是 "BE" 或 "LE"constendianness=os.endianness()
// 操作系统的主机名consthostname=os.hostname()
// 操作系统名consttype=os.type()
// 操作系统名constplatform=os.platform()
// 操作系统运行的时间,以秒为单位consttime=os.uptime()
// 系统内存总量,单位为字节。consttotalMemory=os.totalmem()
// 操作系统空闲内存量,单位是字节。constfreeMemory=os.freemem()
console.log({ endianness, hostname, type, platform, time, totalMemory, freeMemory });

执行结果:

image.png

目录
相关文章
|
9天前
|
JavaScript 前端开发
Vue、ElementUI配合Node、multiparty模块实现图片上传并反显_小demo
如何使用Vue和Element UI配合Node.js及multiparty模块实现图片上传并反显的功能,包括前端的Element UI组件配置和后端的Node.js服务端代码实现。
14 1
Vue、ElementUI配合Node、multiparty模块实现图片上传并反显_小demo
os模块和sys模块
os模块和sys模块
|
7天前
|
Python
python之os模块
python之os模块
|
3天前
|
Python
使用 os 模块更高效地读写文件
使用 os 模块更高效地读写文件
7 0
|
4天前
|
移动开发 Unix Linux
30天拿下Python之os模块
30天拿下Python之os模块
|
2月前
|
存储 缓存 JSON
Node.js有哪些模块系统
【8月更文挑战第12天】Node.js有哪些模块系统
35 3
|
2月前
[译] Node 模块中的 peer dependencies 是什么?
[译] Node 模块中的 peer dependencies 是什么?
|
2月前
|
JavaScript Linux Windows
【应用服务 App Service】NodeJS +Egg 发布到App Service时遇见 [ERR_SYSTEM_ERROR]: A system error occurred:uv_os_get_passwd returned ENOENT(no such file or directory)
【应用服务 App Service】NodeJS +Egg 发布到App Service时遇见 [ERR_SYSTEM_ERROR]: A system error occurred:uv_os_get_passwd returned ENOENT(no such file or directory)
|
3月前
|
存储 JavaScript 安全
Node中的AsyncLocalStorage 使用问题之AsyncLocalStorage与node:async_hooks模块的问题如何解决
Node中的AsyncLocalStorage 使用问题之AsyncLocalStorage与node:async_hooks模块的问题如何解决
|
2月前
|
存储 JavaScript 前端开发
nodejs os模块
nodejs os模块
29 0
下一篇
无影云桌面