Socket
Socket
Sign inDemoInstall

ipgeolocation

Package Overview
Dependencies
1
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.6 to 2.0.0

49

index.js

@@ -6,15 +6,15 @@ exports.Ipgeo = function Ipgeo(apiKey){

this.ipgeoByFieldsAndIp = function(fields="" ,ip="") {
request("ipgeo", this.apiKey, fields, ip);
request("ipgeo", this.apiKey, fields, ip, "");
};
this.ipgeoByFields = function(fields="") {
request("ipgeo", this.apiKey, fields, "");
request("ipgeo", this.apiKey, fields, "", "");
};
this.ipgeoByIp = function(ip="") {
request("ipgeo", this.apiKey, "", ip);
request("ipgeo", this.apiKey, "", ip, "");
};
this.ipgeoByApikey = function(){
request("ipgeo", this.apiKey,"","")
request("ipgeo", this.apiKey, "", "", "")
};

@@ -30,29 +30,36 @@

this.timezoneByIp = function(ip="") {
request("timezone", this.apiKey,"",ip);
request("timezone", this.apiKey, "", ip, "");
}
this.timezoneByApikey = function() {
request("timezone", this.apiKey,"","");
request("timezone", this.apiKey, "", "", "");
}
this.timezoneByTz = function(tz="") {
request("timezone", this.apiKey, "", "", tz);
}
}
function request(subUrl=null, apiKey="",fields="",ip=""){
function request(subUrl=null, apiKey="", fields="", ip="", tz=""){
var URL = "";
if(apiKey){
URL = subUrl;
URL = URL + ("?apiKey=" + apiKey);
}
if(fields){
URL = URL + "&fields=";
URL = URL + fields;
}
if(ip){
URL = URL + "&ip=";
URL = URL + ip;
}
URL = subUrl;
URL = URL + ("?apiKey=" + apiKey);
if(fields){
URL = URL + "&fields=";
URL = URL + fields;
}
if(ip){
URL = URL + "&ip=";
URL = URL + ip;
}
if(tz){
URL = URL + "&tz=";
URL = URL + tz;
}
}
var data = null;

@@ -64,3 +71,5 @@ var XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest;

if (this.readyState === 4) {
console.log(this.responseText);
var data = JSON.parse(this.responseText);
console.log(data);
return data;
}

@@ -67,0 +76,0 @@ });

{
"name": "ipgeolocation",
"version": "1.1.6",
"version": "2.0.0",
"description": "new pkg",

@@ -10,5 +10,5 @@ "main": "index.js",

"keywords": [
"demo"
"ipgeolocation"
],
"author": "NPM Demo <ahsan@jfreaks.com> (http://ipgeolocation.io)",
"author": "NPM ipgeolocation <support@ipgeolocation.io> (http://ipgeolocation.io)",
"license": "ISC",

@@ -15,0 +15,0 @@ "dependencies": {

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