How to use the systeminformation.mem function in systeminformation

To help you get started, we’ve selected a few systeminformation examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Polymer / tachometer / src / json-output.ts View on Github external
export async function legacyJsonOutput(results: BenchmarkResult[]):
    Promise {
  // TODO Add git info.
  const battery = await systeminformation.battery();
  const cpu = await systeminformation.cpu();
  const currentLoad = await systeminformation.currentLoad();
  const memory = await systeminformation.mem();
  return {
    benchmarks: results,
    datetime: new Date().toISOString(),
    system: {
      cpu: {
        manufacturer: cpu.manufacturer,
        model: cpu.model,
        family: cpu.family,
        speed: cpu.speed,
        cores: cpu.cores,
      },
      load: {
        average: currentLoad.avgload,
        current: currentLoad.currentload,
      },
      battery: {
github dreamnettech / dreamtime / src / electron / src / modules / tools / system.js View on Github external
async setup() {
    const [
      graphics,
      os,
      cpu,
      mem,
      online,
    ] = await Promise.all([
      si.graphics(),
      si.osInfo(),
      si.cpu(),
      si.mem(),
      isOnline(),
    ])

    this._graphics = graphics
    this.os = os
    this.cpu = cpu
    this.memory = mem
    this.online = online

    logger.info(`GPU devices: ${this.graphics.length}`)
    logger.info(`RAM: ${this.memory.total} bytes.`)
    logger.info(`Internet connection: ${this.online}`)
    logger.debug(this)
  }
github RocketChat / Rocket.Chat.Apps-cli / src / misc / cloudAuth.ts View on Github external
private async getEncryptionKey(): Promise {
        const s = await system();
        const c = await cpu();
        const m = await mem();
        const o = await osInfo();

        return s.manufacturer + ';' + s.uuid + ';' + String(c.processors) + ';'
                + c.vendor + ';' + m.total + ';' + o.platform + ';' + o.release;
    }
github oguzhaninan / Stacer / src / components / resources / MemoryHistory.js View on Github external
mounted() {
		si.mem(ram => {
			let totalMem = helpers.prettyMemSize(ram.total)
			let totalSwap = helpers.prettyMemSize(ram.swaptotal)

			for (var i = 0; i < 2; i++)
				this.memoryValues.push((new Array(seconds_max)).fill(0))

			let memoryChart = new Chartkick.LineChart('memory-chart', this.memoryData, {
				colors: ['#2ecc71', '#e74c3c', '#3498db', '#f1c40f', '#9b59b6', '#34495e', '#1abc9c', '#e67e22'],
				min: 0,
				max: Math.max(totalMem, totalSwap),
				legend: true,
				points: false
			})

			setInterval(() => {
				si.mem(ram => {
github callmekory / nezuko / src / commands / utils / SystemInfo.ts View on Github external
const ramInfo = async () => {
      const ram = await si.mem()
      return {
        total: bytesToSize(ram.total),
        used: bytesToSize(ram.active),
        free: bytesToSize(ram.available)
      }
    }
github oguzhaninan / Stacer / src / components / dashboard / MemoryBar.js View on Github external
setInterval(() => {
			si.mem(ram => {
				let usedMem = ram.total - ram.available
				let totalMem = ram.total
				this.memoryValue = helpers.prettyMemSize(usedMem) + ' / ' + helpers.prettyMemSize(totalMem) + 'GB'
				memoryBar.animate(usedMem / totalMem)
			})
		}, 1500)
	}
github dreamnettech / dreamtime / src / electron / src / scripts / tools / system.js View on Github external
async setup() {
    const [
      graphics,
      cpu,
      mem,
      online,
    ] = await Promise.all([
      si.graphics(),
      si.cpu(),
      si.mem(),
      isOnline(),
    ])

    this._graphics = graphics
    this._cpu = cpu
    this._memory = mem
    this.online = online
  }
github TryGhost / Ghost-CLI / lib / commands / doctor / checks / check-memory.js View on Github external
function checkMemory() {
    return sysinfo.mem().then((memoryInfo) => {
        const availableMemory = memoryInfo.available / MB_IN_BYTES;

        if (availableMemory < MIN_MEMORY) {
            return Promise.reject(new SystemError(`You are recommended to have at least ${MIN_MEMORY} MB of memory available for smooth operation. It looks like you have ~${parseInt(availableMemory)} MB available.`));
        }
        return Promise.resolve();
    });
}