Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

geoip-lite

Package Overview
Dependencies
Maintainers
1
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

geoip-lite - npm Package Compare versions

Comparing version 1.0.9 to 1.0.10

README.md

21

lib/city-converter.js

@@ -1,2 +0,3 @@

var fs = require('fs');
var fs = require('fs'),
LineInputStream = require('line-input-stream');

@@ -63,21 +64,11 @@ var bfile = process.argv[2];

function process_input(which, data) {
var lines = data.split(/[\r\n]+/);
lines[0] = lastline[which] + lines[0];
lastline[which] = lines.pop();
lines.forEach(process_data[which]);
//console.log("wrote %d lines", lines.length);
}
var ofd = fs.openSync(ofile, "w");
var lfd = fs.openSync(ofile.replace(/\.dat/, '-names.dat'), "w");
var lstream = fs.createReadStream(lfile);
var lstream = LineInputStream(fs.createReadStream(lfile), /[\r\n]+/);
lstream.setEncoding('utf8');
var bstream = fs.createReadStream(bfile);
var bstream = LineInputStream(fs.createReadStream(bfile), /[\r\n]+/);
bstream.setEncoding('utf8');
lstream.on('data', function(data) { process_input('location', data); });
bstream.on('data', function(data) { process_input('block', data); });
lstream.on('line', process_data['location']);
bstream.on('line', process_data['block']);

@@ -1,2 +0,3 @@

var fs = require('fs');
var fs = require('fs'),
LineInputStream = require('line-input-stream');

@@ -11,5 +12,3 @@ var ifile = process.argv[2];

var lastline = "";
function process_line(line, i, a) {
function process_line(line) {
var fields = line.split(/, */);

@@ -80,16 +79,6 @@ if(fields.length < 6) {

function process_input(data) {
var lines = data.split(/[\r\n]+/);
lines[0] = lastline + lines[0];
lastline = lines.pop();
lines.forEach(process_line);
//console.log("wrote %d lines", lines.length);
}
var ofd = fs.openSync(ofile, "w");
var istream = fs.createReadStream(ifile);
var istream = LineInputStream(fs.createReadStream(ifile), /[\r\n]+/);
istream.setEncoding('utf8');
istream.on('data', process_input);
istream.on('line', process_line);

@@ -96,0 +85,0 @@

@@ -35,9 +35,2 @@ var fs = require('fs'),

}
console.warn("\n======================== Warning ========================");
console.warn(" City data not found, falling back to country data.");
console.warn(" Get the latest city data files from\n");
console.warn(" https://github.com/bluesmoon/node-geoip/tree/master/data\n");
console.warn(" You need geoip-city-names.dat and geoip-city.dat");
console.warn(" Put them into the data/ directory for this package");
console.warn("======================== Warning ========================\n\n");
ifile = path.join(geodatadir, 'geoip-country.dat');

@@ -44,0 +37,0 @@ ifd = fs.openSync(ifile, "r");

{
"name" : "geoip-lite",
"version" : "1.0.9",
"version" : "1.0.10",
"description" : "A light weight native JavaScript implementation of GeoIP API from MaxMind",

@@ -16,4 +16,5 @@ "keywords" : ["geo", "geoip", "ip", "ipv4", "ipv6", "geolookup", "maxmind", "geolite"],

"devDependencies": {
"mocha": "~1.0.3"
"mocha": "~1.0.3",
"line-input-stream": "~1.0.0"
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc