🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

check-localhost

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

check-localhost

Check if dns name or ip address belongs to local machine

0.0.1
latest
Source
npm
Version published
Weekly downloads
6
-70%
Maintainers
1
Weekly downloads
 
Created
Source

check-localhost

Check if ip address or dns name belong to your local machine

A tiny script that return the promise, if it 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

Keywords

localhost

FAQs

Package last updated on 23 Oct 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts