NodeJS - hostname
by
Jeremy Canfield |
Updated: March 23 2024
| NodeJS articles
os can be used to get the system hostname in NodeJS. In this example, the full system hostname will be printed.
const os = require("os");
const hostname = os.hostname();
console.log(`hostname = ${hostname}`);
Did you find this article helpful?
If so, consider buying me a coffee over at