Bootstrap FreeKB - NodeJS - hostname
NodeJS - hostname

Updated:   |  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 Buy Me A Coffee



Comments


Add a Comment


Please enter f76eb0 in the box below so that we can be sure you are a human.