New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.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.2.1 to 1.2.2

5

lib/fsWatcher.js

@@ -28,2 +28,7 @@ var fs = require('fs'),

function onWatchEvent(event, changedFile) {
// check to make sure changedFile is not null
if (!changedFile) {
return;
}
var filePath = path.join(directory, changedFile);

@@ -30,0 +35,0 @@

4

package.json
{
"name" : "geoip-lite",
"version" : "1.2.1",
"version" : "1.2.2",
"description" : "A light weight native JavaScript implementation of GeoIP API from MaxMind",

@@ -24,3 +24,3 @@ "keywords" : ["geo", "geoip", "ip", "ipv4", "ipv6", "geolookup", "maxmind", "geolite"],

"rimraf": "^2.5.2",
"unzip": "^0.1.11"
"yauzl": "^2.9.2"
},

@@ -27,0 +27,0 @@ "config": {

@@ -21,3 +21,3 @@ // fetches and converts maxmind lite databases

var rimraf = require('rimraf').sync;
var unzip = require('unzip');
var yauzl = require('yauzl');
var utils = require('../lib/utils');

@@ -164,16 +164,33 @@

process.stdout.write('Extracting ' + tmpFileName + ' ...');
fs.createReadStream(tmpFile)
.pipe(unzip.Parse())
.on('entry', function(entry) {
var fileName = path.basename(entry.path);
var type = entry.type; // 'Directory' or 'File'
if (type.toLowerCase() === 'file' && path.extname(fileName) === '.csv') {
entry.pipe(fs.createWriteStream(path.join(tmpPath, fileName)));
yauzl.open(tmpFile, {autoClose: true, lazyEntries: true}, function(err, zipfile) {
if (err) {
throw err;
}
zipfile.readEntry();
zipfile.on("entry", function(entry) {
if (/\/$/.test(entry.fileName)) {
// Directory file names end with '/'.
// Note that entries for directories themselves are optional.
// An entry's fileName implicitly requires its parent directories to exist.
zipfile.readEntry();
} else {
entry.autodrain();
// file entry
zipfile.openReadStream(entry, function(err, readStream) {
if (err) {
throw err;
}
readStream.on("end", function() {
zipfile.readEntry();
});
var filePath = entry.fileName.split("/");
// filePath will always have length >= 1, as split() always returns an array of at least one string
var fileName = filePath[filePath.length - 1];
readStream.pipe(fs.createWriteStream(path.join(tmpPath, fileName)));
});
}
})
.on('finish', function() {
});
zipfile.once("end", function() {
cb(null, database);
});
});
}

@@ -180,0 +197,0 @@ }

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