I am working on web analytics, we are using node.js in server side, we are sending the data using http request(express framework).
Requirement:Have to find the latitude and longitude of the visitor.
My question is how to find the latitude and longitude in node.js? Any framework available?
I strongly recommend to use the HTML5 geolocation API inside the browser and then send visitor location information to your server – that's way more accurate than using geolocation from IP addresses on the server-side. You will be getting the location of the ISPs, which can be quite far away, and in addition the IP-to-location databases aren't always up to date with the latest changes, so you might won't get any data for a particular IP address.
To find out more about this topic take a look at MaxMind, which offers a popular IP-to-location database published some statistics on its database: GeoIP City Accuracy for Selected Countries
Here's a great example of using navigator.geolocation:
take a look here
http://tympanus.net/codrops/2012/10/11/real-time-geolocation-service-with-node-js/
a good tutorial.
If the visitor is visiting your site via a browser, then you are asking the question on the wrong technology.
Node.js is a serverside technology, which means it can't access the user's geolocation directly.
What you should be asking is how to get geolocation using javascript on the clientside, and then simply send that information to your server via Ajax.
That question is very easy to answer: http://www.w3schools.com/html/html5_geolocation.asp . There are ofcourse libraries that will ease the use of this.
If you can't, don't want to, or don't want to bother getting the information clientSide, then you can try and match the IP (which is what Maxmind does, though I'm not sure if they'll give you the longitude and latitide or just a city name).
However these will not be exact, especially if your visitors are using devices with geolocation capabilities (such as mobile phones).