Sha256: 1e7dcd85e7c6048416e75ae3a98e6b66536e18c0d1e2f9eeebc3556ab5aa55cc
Contents?: true
Size: 785 Bytes
Versions: 5
Compression:
Stored size: 785 Bytes
Contents
const os = require('os'); const process = require('process'); class RuntimeLogger { static notLoggedYet = true; static getRuntimeInfo() { try { return `JavaScript Managed Runtime Info:\n` + `Node.js Version: ${process.version}\n` + `OS Version: ${os.type()} ${os.release()}\n` + `Process Architecture: ${os.arch()}\n` + `Current Directory: ${process.cwd()}\n`; } catch (e) { return "JavaScript Managed Runtime Info: Error while fetching runtime info"; } } static printRuntimeInfo() { if (this.notLoggedYet) { console.log(this.getRuntimeInfo()); this.notLoggedYet = false; } } } module.exports = RuntimeLogger;
Version data entries
5 entries across 5 versions & 1 rubygems