Predicate for whether the current document location is localhost
$ npm install --save is-this-local
Browser only. Chiefly meant to be used with Browserify.
// if current page host is a loopback address
var isLocal = require('is-this-local');
//=> true
// is current page host is not a loopback address
var isLocal = require('is-this-local');
//=> false
MIT © Victor Nascimento Bakke