Join our webinar on Wednesday, June 26, at 1pm EDTHow Chia Mitigates Risk in the Crypto Industry.Register
Socket
Socket
Sign inDemoInstall

external-ip

Package Overview
Dependencies
8
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.1 to 1.1.0

26

lib/extIP.js

@@ -24,4 +24,4 @@ 'use strict';

sequential: (cb) => {
let errors = [];
let current = 0;
let errors = [];

@@ -32,5 +32,5 @@ const loop = () => {

errors.push(error);
current += 1;
current +=1;
// when every single service has failed tell the bad news
if (current === requests.length) {
if (errors.length === requests.length) {
return cb(utils.concatErrors(errors), null);

@@ -51,13 +51,3 @@ }

const abort = (requests) => {
process.nextTick(() => {
requests.forEach((request) => {
request.abort();
});
});
};
const onResponse = (err, ip) => {
let onResponse = function (err, ip) {
if (done) {

@@ -71,3 +61,9 @@ return;

done = true;
abort(ongoingRequests); //async
ongoingRequests.forEach((request) => {
if (this === request) {
return;
}
request.abort();
});
ongoingRequests = null;
return cb(null, ip);

@@ -74,0 +70,0 @@ }

@@ -5,3 +5,3 @@ 'use strict';

const net = require('net');
const request = require('request');
const get = require('simple-get');

@@ -57,3 +57,3 @@ /**

return (cb) => {
return request.get({
return get.concat({
url: url,

@@ -64,6 +64,5 @@ timeout: config.timeout,

}
}, (error, res, body = '') => {
// if the body is null use an empty string
}, (error, res, body = '') => { // if the body is falsey use an empty string
if (error) {
return cb(new Error(`${error.code} from ${url}`), null);
return cb(new Error(`${error.message} from ${url}`), null);
}

@@ -70,0 +69,0 @@ // Parse and validate the body

{
"name": "external-ip",
"version": "1.0.1",
"version": "1.1.0",
"description": "A node.js library to get your external ip from multiple services",

@@ -38,4 +38,4 @@ "main": "index.js",

"commander": "^2.9.0",
"request": "^2.81.0",
"revalidator": "^0.3.1"
"revalidator": "^0.3.1",
"simple-get": "^2.6.0"
},

@@ -42,0 +42,0 @@ "devDependencies": {

@@ -12,2 +12,3 @@ 'http://ip.appspot.com/',

test cli
npm badge
https://www.npmjs.com/package/simple-get
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc