Skip to content

DavideViolante/useragents-me-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Useragents.me Node.js APIs wrapper

Coverage Status Maintainability npm Donate

NPM

Simple Node.js wrapper for useragents.me.

Install

npm i useragents-me-api

Example

const { useragentsme } = require('useragents-me-api');

async function main() {
  try {
    // Get most common mobile user agents
    const mobileUserAgents = await useragentsme(); // Default arg is 'mobile'
    console.log(mobileUserAgents); // [{"ua": "Mozilla/5.0...", "pct": 44.123...}, ...]
    // Get most common desktop user agents
    const desktopUserAgents = await useragentsme('desktop');
    console.log(desktopUserAgents); // [{"ua": "Mozilla/5.0...", "pct": 40.123...}, ...]
  } catch (error) {
    console.log(error);
  }
}

Run tests

npm test

Run lint

npm run lint

Author

About

Node.js wrapper for useragents.me

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors