UNPKG

yunzai-micro-plugin

Version:

Yunzai开发管理面板

23 lines (20 loc) 586 B
import os from 'os'; import { getFileSize } from './utils.js'; async function getNodeInfo() { let memory = process.memoryUsage(); let rss = getFileSize(memory.rss); let heapTotal = getFileSize(memory.heapTotal); let heapUsed = getFileSize(memory.heapUsed); let occupy = Number((memory.rss / (os.totalmem() - os.freemem())).toFixed(2)); return { inner: Math.round(occupy * 100), title: "Node", info: { rss, heapTotal, heapUsed, occupy } }; } export { getNodeInfo as default };