
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
device-ip-location
Advanced tools
Get device information from your systems users including device, operating system and version, and an abundance of location information from their ip.
Use for security management i.e password resetting & detecting new sign in devices etc.
See https://www.npmjs.com/package/device-ip-location
npm i device-ip-location
const device = require('device-ip-location');
//Make sure to bypass the reverse proxy by allowing for IP visibility by enabling proxy trust if you're using express:
app.enable('trust proxy');
// Use the request data to access the required parameters (ip and header)
// Example agent - 'Mozilla/5.0 (Linux; Android 5.0; NX505J Build/KVT49L) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.78 Mobile Safari/537.36';
var agent = req.headers['user-agent'];
// Example requestIp - 105.4.4.147
var requestIp = req.ip
device.getInfo(agent,requestIp,function(err,res){
if(err){
console.log(err);
return
}
console.log(res);
})
{ "device":
{ "os":
{ "short_name": "WIN",
"name": "Windows",
"version": "10",
"platform": "x64",
"family": "Windows" },
"device": { "id": "", "type": "desktop", "brand": "", "model": "" },
"client":
{ "engine": "Blink",
"engine_version": "",
"short_name": "CH",
"name": "Chrome",
"version": "69.0.3497.100",
"type": "browser" } },
"locale":
{ "ip": "105.4.4.147",
"type": "ipv4",
"continent_code": "AF",
"continent_name": "Africa",
"country_code": "ZA",
"country_name": "South Africa",
"region_code": "GT",
"region_name": "Gauteng",
"city": "Johannesburg",
"zip": "2000",
"latitude": -26.2309,
"longitude": 28.0583,
"location":
{ "geoname_id": 993800,
"capital": "Pretoria",
"languages": [],
"country_flag": "http://assets.ipstack.com/flags/za.svg",
"country_flag_emoji": "🇿🇦",
"country_flag_emoji_unicode": "U+1F1FF U+1F1E6",
"calling_code": "27",
"is_eu": false } } }
FAQs
Get device information from your systems users including device, operating system and version, and an abundance of location information from their ip.
The npm package device-ip-location receives a total of 11 weekly downloads. As such, device-ip-location popularity was classified as not popular.
We found that device-ip-location demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.