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

locate-user

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

locate-user - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

2

package.json
{
"name": "locate-user",
"version": "1.0.0",
"version": "1.0.1",
"description": "Know Your Client/User's Location",

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

@@ -28,10 +28,35 @@ # locate-user

http.createServer(function (req, res) {
const userLocation = locateUser(req);
res.end(userLocation);
http.createServer(function(req, res) {
const userLocation = locateUser(req);
userLocation
.then(data => {
res.setHeader('Content-Type', 'application/json');
res.end(JSON.stringify(data));
})
.catch(error => {
console.error(error)
});
}).listen(3000);
```
## Usage (Using Express.JS)
```js
'use strict';
const express = require('express');
const locateUser = require('locate-user');
const app = express();
app.get('/', (req, res, next) => {
const userLocation = locateUser(req);
userLocation
.then(data => res.json(data))
.catch(next);
})
app.listen(3000)
```
### Please Contribute And Improve It..

@@ -38,0 +63,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