How to use the systeminformation.fsSize 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 sykeben / RasDash / api.js View on Github external
api.get('/fs/:id/total', function(req, res) { // Total GB in File System (fs/[id]/used)
  si.fsSize()
    .then(data => res.send((data[parseInt(req.params.id)].size/(1024*1024*1024)).toString()))
    .catch(error => res.status(404).send(siError))
})
github EnKrypt / Doppler / backend / src / app.ts View on Github external
const poll = async () => {
    cpuLoad = await SI.currentLoad();
    mem = await SI.mem();
    disk = await SI.fsSize();
    processes = await SI.processes();
    network = await SI.networkStats();
    try {
        cpuTemp = await SI.cpuTemperature();
        if (!cpuTemp.cores.length) {
            throw new Error('Cannot monitor CPU temperature');
        }
    } catch (e) {
        cpuTemp = {
            main: 0,
            cores: Array(cpu.cores).fill(0),
            max: 0
        };
        if (!tempFlag) {
            console.warn(
                'Cannot pull temperature data. On Linux, make sure `sensors` is available (package: lm-sensors). For OS X, install osx-temperature-sensor. Some CPUs are not supported on Windows.'
github oguzhaninan / Stacer / src / dashboard.js View on Github external
function diskInfo ()
  {
    si.fsSize( ( disk ) => {
      dUsed  = helpers.prettyDiskSize( disk[0].used )
      dTotal = helpers.prettyDiskSize( disk[0].size )
      diskBar.animate( disk[0].use / 100 )
    })
  }
  diskInfo()
github nukeop / pi-dashboard / lib / disk.js View on Github external
this.gauge = this.grid.set(0, 0, 1, 1, contrib.gauge, {
      label: this.labelTop,
      stroke: 'red',
      fill: 'white'      
    });

    this.table = this.grid.set(1, 0, 1, 1, contrib.table, {
      label: this.labelBottom,
      width: '100%',
      height: '100%',
      columnWidth: [10, 15],
      fg: 'white',
      selectedBg: 'black'
    });

    si.fsSize(data => {
      let disk = _.find(data, {fs: config.monitoredDisk});
      this.gauge.setPercent(disk.use);
      
      this.table.setData({
	headers: ['Type', 'Space'],
	data: [
	  ['taken', (disk.used/(1024 * 1024 * 1024)).toFixed(2) + ' GB'],
	  ['free', ((disk.size - disk.used)/(1024 * 1024 * 1024)).toFixed(2) + ' GB'],
	  ['total', (disk.size/(1024 * 1024 * 1024)).toFixed(2) + ' GB']
	]
      });

      this.draw();
    });
  }
github aksakalli / gtop / lib / monitor / disk.js View on Github external
function Disk(donut) {
  this.donut = donut;

  si.fsSize(data => {
    this.updateData(data);
  })

  this.interval = setInterval(() => {
    si.fsSize(data => {
      this.updateData(data);
    })
  }, 10000);
}
github DeadPackets / HackPi / server / functions / fn.js View on Github external
export const UpdateFSInfo = () => {
	var fssize = si.fsSize(function(fssize) {
		var ioinfo = si.disksIO(function(ioinfo) {
			var rwinfo = si.fsStats(function(rwinfo) {
				SYSINFO.fs = {
					fssize,
					ioinfo,
					rwinfo
				}
			})
		})
	})
}
github sbuggay / sentry / packages / sentry-server-data / src / Server.ts View on Github external
export async function dynamicInfo(): Promise {
	const osData = {
		hostname: os.hostname(),
		uptime: os.uptime(),
		freemem: os.freemem(),
		totalmem: os.totalmem(),
		cpus: os.cpus(),
		loadavg: os.loadavg()
	}

	const promises = [
		si.battery(),
		si.graphics(),
		si.osInfo(),
		si.fsSize(),
		si.cpuTemperature()
	];

	const [battery, graphics, osInfo, fsSize, cpuTemp] = await Promise.all(promises);
	return {
		...osData,
		battery,
		graphics,
		osInfo,
		fsSize,
		cpuTemp
	};

}