Say you are using Grunt or Gulp on a team. You need to have your Gulp or Gruntfile in version control so that any changes or improvements can be enjoyed (or endured) by everyone.
Now let’s say you all want to be running a cool task like Browser Sync and due to the network neck-beards and their crazy rules, you need to specify your host explicitly using your IP (eg. 192.168.X.XX). All your IP addresses are different though! Oh noes. Looks like you’ll have to manually edit it every time.
Or you could use the built in Node OS API. Like so:
Now whenever anyone runs the gulp or grunt (or any node thingy) it will get their IP and use that. Swag.