useragents-me-api
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

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

Package Sidebar

Install

npm i useragents-me-api

Weekly Downloads

1

Version

1.2.0

License

MIT

Unpacked Size

8.79 kB

Total Files

12

Last publish

Collaborators

  • davideviolante