Skip to content

Commit dbeefab

Browse files
author
K.C.Ashish Kumar
committed
Release 5.0.0
1 parent 21cfc4a commit dbeefab

File tree

8 files changed

+21
-21
lines changed

8 files changed

+21
-21
lines changed

cli/index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77

88
require('../utils/io').blockInput();
99

10-
(function() {
10+
(function () {
1111
const myip = require('../exec');
1212
const externalip = require('../exec/external');
1313
const pkgInfo = require('../package.json');
1414
const formatter = require('../utils/formatter');
15-
const {print, printLine} = require('../utils/printer');
15+
const { print, printLine } = require('../utils/printer');
1616
const chalk = require("chalk");
1717
const hosts = myip();
1818
const BOX_SIZE = 56;
@@ -33,7 +33,7 @@ require('../utils/io').blockInput();
3333
printLine(BOX_SIZE);
3434
print(chalk.blue.bgWhite(formatter(` | IP Address | Usage in a web-browser | `, true, BOX_SIZE + 2)));
3535
printLine(BOX_SIZE);
36-
hosts.forEach(host=>{
36+
hosts.forEach(host => {
3737
let hostText = chalk.bold(host);
3838
print(chalk.blue.bgWhite(formatter(` | ${formatter(hostText, {
3939
length: 15 + hostText.length - host.length
@@ -44,14 +44,14 @@ require('../utils/io').blockInput();
4444
printLine(BOX_SIZE);
4545
print(EMPTY_LINE);
4646

47-
let endProg = function() {
47+
let endProg = function () {
4848
print();
4949
print(`For more cool stuff, visit: https://github.com/kcak11`);
5050
print();
5151
process.exit(0);
5252
};
5353

54-
externalip().then((data)=>{
54+
externalip().then((data) => {
5555
let externalIP = chalk.bold(data.myip);
5656
let country = chalk.bold(data.country);
5757
print(chalk.red.bgWhite(` ${formatter("External(public) IP: " + externalIP, {
@@ -66,7 +66,7 @@ require('../utils/io').blockInput();
6666
})}`));
6767
print(EMPTY_LINE);
6868
endProg();
69-
}).catch(()=>{
69+
}).catch((err) => {
7070
endProg();
7171
});
7272
})();

exec/external.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88

99
const axios = require('axios');
1010

11-
module.exports = function(action) {
12-
let promise = axios.get("https://cors.kcak11.com/?myip=yes");
13-
return new Promise((resolve, reject)=>{
14-
promise.then((response)=>{
11+
module.exports = function (action) {
12+
let promise = axios.get("https://cors.kcak11.workers.dev/?myip=yes");
13+
return new Promise((resolve, reject) => {
14+
promise.then((response) => {
1515
resolve(response.data);
16-
}).catch((err)=>{
16+
}).catch((err) => {
1717
reject(err);
1818
});
1919
});

exec/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
const os = require('os');
77
const ifaces = os.networkInterfaces();
88

9-
module.exports = function() {
9+
module.exports = function () {
1010
let hosts = [];
11-
Object.keys(ifaces).forEach((ifname)=>{
12-
ifaces[ifname].forEach((iface)=>{
11+
Object.keys(ifaces).forEach((ifname) => {
12+
ifaces[ifname].forEach((iface) => {
1313
if ('IPv4' !== iface.family || iface.internal !== false) {
1414
// skip over internal (i.e. 127.0.0.1) and non-ipv4 addresses
1515
return;

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@kcak11/myip",
3-
"version": "4.1.1",
3+
"version": "5.0.0",
44
"description": "A Utility to fetch IP Addresses",
55
"main": "./exec/index.js",
66
"scripts": {

utils/formatter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Author: @kcak11
44
**/
55

6-
module.exports = function(inp, cfg) {
6+
module.exports = function (inp, cfg) {
77
if (!inp) {
88
return inp;
99
}

utils/io.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const rl = readline.createInterface({
55
});
66

77
module.exports = {
8-
blockInput: function(){
8+
blockInput: function () {
99
rl.pause();
1010
}
1111
};

utils/printer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
const chalk = require("chalk");
77

88
module.exports = {
9-
print: function() {
9+
print: function () {
1010
console.log.apply(console, arguments);
1111
},
12-
printLine: function(length) {
12+
printLine: function (length) {
1313
let str = "";
1414
for (let i = 0; i < length; ++i) {
1515
str += "~";

0 commit comments

Comments
 (0)