Will the real user agent please stand up?
Get an up-to-date user-agent string, sourced from the most common user agents. To avoid each use of this module hammering the source, the data is now self-hosted in this repository, available via cdn. A simple local cache, invalidated every 2 hours, prevents extra requests. A data cap is implemented in the request. The local ua.json is used as a fallback in case the data is corrupt or host is unreachable.
const userAgent = ;// most common user-agent stringconst ua = await ;// array of top 10 most common user-agent stringsconst topTen = await userAgentall;// round robin top 10 most common user-agentsconst randomUA = await userAgent;const anotherUA = await userAgent;// 5th most common user-agentconst fifth = await userAgent;// random user-agentconst randomUA = await userAgent;
const request = ;const userAgent = ;;
This project is licensed under the ISC License - see the LICENSE file for details.