Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/paulmillr/popular-user-agents
Regularly updated list of popular user agents aka browser versions
https://github.com/paulmillr/popular-user-agents
Last synced: 3 months ago
JSON representation
Regularly updated list of popular user agents aka browser versions
- Host: GitHub
- URL: https://github.com/paulmillr/popular-user-agents
- Owner: paulmillr
- Created: 2022-07-09T01:08:11.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-03-16T19:27:51.000Z (almost 2 years ago)
- Last Synced: 2024-10-04T19:37:49.303Z (3 months ago)
- Language: JavaScript
- Size: 5.86 KB
- Stars: 6
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# popular-user-agents
Regularly updated list of popular user agents aka browser versions.
Package version itself corresponds to update date: 0.1.2207 = 2022.07.
## Usage
> npm i popular-user-agents
There are two methods: `randomList` and `random`.
- `randomList` would return the popular user agent list, shuffled
- `random` would return first element from the listThe package checks if it's older than 4 months by diffing current date to package's variable.
If it's too old, an error would be thrown when either of the methods is called.```ts
import { random, randomList } from 'popular-user-agents';
console.log(random());
// Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36
```## License
MIT License (c) Paul Miller (https://paulmillr.com)