Skip to content

up-tri/global-ip.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

global-ip

the simple wrapper of ip-api.com

const GlobalIP = require("./../src");

const gip = new GlobalIP();
gip
  .execute()
  .then((ip) => {
    console.log(ip);
  })
  .catch((errorCode) => {
    switch (errorCode) {
      case gip.CANNOT_FETCH_SELF_IP:
        console.log("cannot fetch ip");
        break;
      case gip.CANNOT_CONNECT_INTERNET:
        console.log("cannot connect internet");
        break;
      case gip.SOME_ERROR_HAPPENED:
        console.log("unhandled error!");
        break;
    }
  });

developer

up-tri

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published