visitor-info

Gather information about user

Usage no npm install needed!

<script type="module">
  import visitorInfo from 'https://cdn.skypack.dev/visitor-info';
</script>

README

visitor-info

Build Status

Tiny library that wraps other modules useful to gather information about a visitor in Javascript, such as browser, timezone, country, OS, etc...

It is useful in case you want to find fast information about the user without making requests to a third-party API service, but relying on the capabilities of the browser.

How to use

Add visitor-info as a dependency:

npm install visitor-info

Import it in your project as an ES6 module:

import visitorInfo from 'visitor-info'

console.log(visitorInfo())

/*
Result:
{
  browser: {...}
  country: {...}
  cpu: {...}
  device: {...}
  engine: {...}
  os: {...}
  ua: "..."
}
*/

or with require:

var visitorInfo = require('visitor-info')

console.log(visitorInfo())

/*
Result:
{
  browser: {...}
  country: {...}
  cpu: {...}
  device: {...}
  engine: {...}
  os: {...}
  ua: "..."
}
*/