Question: I have seen few examples of using geoip in node.js such as <https://github.com/kuno/GeoIP.git> and <https://github.com/wadey/node-geoip>. However what i want is to display the map showing geoip for the particular loged in user.How can it be implemented.

Answer: 
The best module for GeoIP is <https://github.com/kuno/GeoIP> in my opinion (I actually used this module for a project and it worked perfectly for me). You have to download the database from Maxmind and also install some OS specific libraries and then compile the module.

There is no need to put the database into MongoDB unless you want to replicate easily across multiple servers. You can just put your database into a file and provide the path in the Node.js module.

Here is an example:

```
// Open the GeoLiteCity.dat file first.
var City = geoip.City;
var city = new City('/path/to/GeoLiteCity.dat');
console.log(city); // this contains country, city, lat, long, continent, postal code etc

```
I've just published an NPM module for the [IPLocate.io API](https://www.iplocate.io) which I created, which lets you find the location (city, country and coordinates) based on an IP address.

Super easy, no databases to download, and 1,500 free requests per day.

Install
-------

`npm install node-iplocate`

Usage
-----

```
const iplocate = require("node-iplocate");

iplocate("8.8.8.8").then(function(results) {
  console.log("IP Address: " + results.ip);
  // IP Address: 8.8.8.8
  console.log("Country: " + results.country + " (" + results.country_code + ")"); 
  // Country: United States (US)
  console.log("Continent: " + results.continent); 
  // Continent: North America
  console.log("Organisation: " + results.org + " (" + results.asn + ")"); 
  // Organisation: Google LLC (AS15169)

  console.log(JSON.stringify(results, null, 2));
  /*
    {
      "ip": "8.8.8.8",
      "country": "United States",
      "country_code": "US",
      "city": null,
      "continent": "North America",
      "latitude": 37.751,
      "longitude": -97.822,
      "time_zone": null,
      "postal_code": null,
      "org": "Google LLC",
      "asn": "AS15169"
    }
  */
});

// Or with callbacks
iplocate("8.8.8.8", null, function(err, results) {
  // ...
  console.log(JSON.stringify(results, null, 2));
});

// Provide an API key from IPLocate.io
iplocate("8.8.8.8", { api_key: "abcdef" }).then(function(results) {
  // ...
});

```