cl

check-localhost

Check if dns name or ip address belongs to local machine

Showing:

Popularity

Downloads/wk

15

GitHub Stars

3

Maintenance

Last Commit

4yrs ago

Contributors

0

Package

Dependencies

0

Size (min+gzip)

0.3KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

check-localhost

Check if IP Address or DNS Name belong to your local machine

A tiny script that returns a promise, if IP Address or DNS Name belongs to your local machine.

Installation

check-localhost is on npm, so installing it is as easy as doing:

$ npm install --save check-localhost

Usage

require('check-localhost') in your script. After that you can call it like this (all options are optional):

var checkLocalHost = require('./index.js');

checkLocalHost("127.0.0.1").then(function(islocal){
    console.log("Is 127.0.0.1 localhost -- " + islocal);
})

checkLocalHost("10.0.75.1").then(function(islocal){
    console.log("Is 10.0.75.1 localhost -- " + islocal);
})

checkLocalHost("localhost").then(function(islocal){
    console.log("Is localhost localhost -- " + islocal);
})

checkLocalHost("localhost.relayhub.pitneycloud.com").then(function(islocal){
    console.log("Is localhost.relayhub.pitneycloud.com localhost -- " + islocal);
})

checkLocalHost("localhost2.relayhub.pitneycloud.com").then(function(islocal){
    console.log("Is localhost2.relayhub.pitneycloud.com localhost -- " + islocal);
})

checkLocalHost("localhost2").then(function(islocal){
    console.log("Is localhost2 localhost -- " + islocal);
})

checkLocalHost("192.168.0.110").then(function(islocal){
    console.log("Is 192.168.0.110 localhost -- " + islocal);
})

checkLocalHost("192.168.0.105").then(function(islocal){
    console.log("Is 192.168.0.105 localhost -- " + islocal);
})

Support

IE9 and up

License

MIT

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100