For windows it's console.log(process.env['COMPUTERNAME'])
;
But how to do it for Mac OS?
Try the os
-module:
var os = require('os')
console.log(os.hostname())
This is the best way to get the hostname.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With