How to use os.version:
GitHub: cedalo/management-center
1066 1067 1068 1069 1070 1071 1072 1073 1074 1075
os: { arch: os.arch(), cpus: os.cpus(), platform: os.platform(), release: os.release(), version: os.version() } }); } }, USAGE_TRACKER_INTERVAL);
How to use os.loadavg:
GitHub: lamassu/lamassu-machine
390 391 392 393 394 395 396 397 398 399
if (temperature.value) { clauses.push('CPU temperature: ' + (temperature.value.trim() / 1000) + '° C') } const cpuLoad = os.loadavg()[1].toFixed(2) const memUse = (process.memoryUsage().rss / Math.pow(1000, 2)).toFixed(1) + ' MB' const memFree = (os.freemem() * 100 / os.totalmem()).toFixed(1) + '%' const nodeUptimeMs = Date.now() - self.bootTime
See more examples
How to use os.constants:
GitHub: BuilderIO/qwik-build
3074 3075 3076 3077 3078 3079 3080 3081 3082 3083
standard } }; }; var findSignalByNumber = function(number, signals) { const signal = signals.find(({ name }) => import_node_os2.constants.signals[name] === number); if (signal !== void 0) { return signal; } return signals.find((signalA) => signalA.number === number);
How to use os.default:
GitHub: gethexon/hexon
2199 2200 2201 2202 2203 2204 2205 2206 2207 2208
const min = forceColor || 0; if (env.TERM === "dumb") { return min; } if (import_node_process.default.platform === "win32") { const osRelease = import_node_os.default.release().split("."); if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) { return Number(osRelease[2]) >= 14931 ? 3 : 2; } return 1;
See more examples
How to use os.uptime:
GitHub: rpmaya/u-tad-Server
27 28 29 30 31 32 33 34 35 36 37 38
//2.3 Module OS const os = require("os"); console.log("SO:", os.type()); console.log("DIR:", os.homedir()); console.log("UP:", os.uptime()); console.log("USER:", os.userInfo()); /*2.4 Timers //setTimeout(funcion, retraso, arg1DeLaFuncion, arg2DeLaFuncion, ...)
How to use os.homedir:
GitHub: rpmaya/u-tad-Server
26 27 28 29 30 31 32 33 34 35 36 37
console.log(process.memoryUsage()); //2.3 Module OS const os = require("os"); console.log("SO:", os.type()); console.log("DIR:", os.homedir()); console.log("UP:", os.uptime()); console.log("USER:", os.userInfo()); /*2.4 Timers
How to use os.release:
GitHub: cedalo/management-center
1065 1066 1067 1068 1069 1070 1071 1072 1073 1074
data, os: { arch: os.arch(), cpus: os.cpus(), platform: os.platform(), release: os.release(), version: os.version() } }); }
How to use os.EOL:
GitHub: cenfun/starfall-cli
1530 1531 1532 1533 1534 1535 1536 1537 1538 1539
return ascObj; }, getEOL: function(content) { if (!content) { return os.EOL; } const nIndex = content.lastIndexOf('\n'); if (nIndex === -1) { return os.EOL;
How to use os.networkInterfaces:
GitHub: vitalif/vitastor
1775 1776 1777 1778 1779 1780 1781 1782 1783 1784
} local_ips(all) { const ips = []; const ifaces = os.networkInterfaces(); for (const ifname in ifaces) { for (const iface of ifaces[ifname]) {
See more examples
How to use os.userInfo:
GitHub: rpmaya/u-tad-Server
28 29 30 31 32 33 34 35 36 37 38
//2.3 Module OS const os = require("os"); console.log("SO:", os.type()); console.log("DIR:", os.homedir()); console.log("UP:", os.uptime()); console.log("USER:", os.userInfo()); /*2.4 Timers //setTimeout(funcion, retraso, arg1DeLaFuncion, arg2DeLaFuncion, ...) function mostrarTema(tema) {
How to use os.type:
GitHub: rpmaya/u-tad-Server
25 26 27 28 29 30 31 32 33 34 35
} console.log(process.memoryUsage()); //2.3 Module OS const os = require("os"); console.log("SO:", os.type()); console.log("DIR:", os.homedir()); console.log("UP:", os.uptime()); console.log("USER:", os.userInfo());
How to use os.arch:
2 3 4 5 6 7 8 9 10 11 12 13
const fs = require('fs') const path = require('path') const os = require('os') const cp = require('child_process') const host_arch = os.arch() // Parse args. let cc_wrapper let build_type = 'Release'
See more examples
How to use os.totalmem:
GitHub: lamassu/lamassu-machine
393 394 395 396 397 398 399 400 401 402
} const cpuLoad = os.loadavg()[1].toFixed(2) const memUse = (process.memoryUsage().rss / Math.pow(1000, 2)).toFixed(1) + ' MB' const memFree = (os.freemem() * 100 / os.totalmem()).toFixed(1) + '%' const nodeUptimeMs = Date.now() - self.bootTime const nodeUptime = (nodeUptimeMs / 3600000).toFixed(2) + 'h' const osUptime = (os.uptime() / 3600).toFixed(2) + 'h' const format = clauses.join(', ')
See more examples
How to use os.tmpdir:
532 533 534 535 536 537 538 539 540 541
files = filesFromFields.call(this, this.body) } else { files = await this.files(options) } const requestFiles = [] const tmpdir = (options && options.tmpdir) || os.tmpdir() this.tmpUploads = [] for await (const file of files) { const filepath = path.join(tmpdir, toID() + path.extname(file.filename)) const target = createWriteStream(filepath)
See more examples
How to use os.hostname:
GitHub: DataDog/dd-trace-js
36 37 38 39 40 41 42 43 44 45
class Config { constructor (options = {}) { const enabled = coalesce(options.enabled, DD_PROFILING_ENABLED, true) const env = coalesce(options.env, DD_ENV) const service = options.service || DD_SERVICE || 'node' const host = os.hostname() const version = coalesce(options.version, DD_VERSION) const functionname = process.env.AWS_LAMBDA_FUNCTION_NAME // Must be longer than one minute so pad with five seconds const flushInterval = coalesce(options.interval, Number(DD_PROFILING_UPLOAD_PERIOD) * 1000, 65 * 1000)
See more examples
How to use os.cpus:
GitHub: thumbsup/thumbsup
152 153 154 155 156 157 158 159 160 161
}, 'concurrency': { group: 'Output options:', description: 'Number of parallel parsing/processing operations', type: 'number', 'default': os.cpus().length }, 'output-structure': { group: 'Output options:', description: 'File and folder structure for output media',
See more examples
How to use os.platform:
539 540 541 542 543 544 545 546 547 548 549 550 551
} // async handleBlueZManagedObjects(error, objects) async function init() { // Bounce if bluetooth disabled or wrong platform if (config.media.bluetooth.enable === false || os.platform() !== 'linux') return false; // systemd dbus libraries if (bluetooth.dbus === null) { bluetooth.dbus = require('dbus-native');
See more examples
How to use os.freemem:
84 85 86 87 88 89 90 91 92 93
mcutil.status('127.0.0.1', data["query.port"], mcu_options) .then(function (data) { osutils.cpuUsage(function (value) { data["cpu"] = Math.round(value * 100); totalmem = os.totalmem(); usedmem = totalmem - os.freemem(); data["usedmem"] = usedmem; data["totalmem"] = totalmem; cb(data); });
See more examples