Sha256: a8ccb6284945b0a8821dea1e5e90b329f5594260012b437e52defcc3bb4fd474
Contents?: true
Size: 865 Bytes
Versions: 5
Compression:
Stored size: 865 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` ) // eslint-disable-next-line no-unused-vars } 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