
Product
Socket for Jira Is Now Available
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.
modern-random-ua
Advanced tools
Randomly generates User-Agent strings based on actual usage statistics from Wikimedia.
Randomly generates User-Agent strings based on actual browser market share and usage statistics.
Old browser versions removed from this fork
The version numbers generated are sane, however, revisions are totally random and unlikely to exist in the wild.
I decided not to include language selection found in the PHP version and instead include all the languages in the ISO639-2 standard because it's atypical for sites to determine client locale based on the user-agent.
var random_ua = require('modern-random-ua');
console.log(random_ua.generate());
//Easy like Sunday morning
//You can easily use random_ua to generate a random User-Agent for an HTTP request:
var http = require('http');
http.get({
host:'whatsmyuseragent.com',
path:'/',
headers:{
'User-Agent':random_ua.generate()
}
},
function (res) {
if (res.statusCode === 200) {
var body = [];
res.setEncoding('utf8');
res.on('data', function (chunk) {
body.push(chunk);
});
res.on('end', function () {
body = body.join('');
console.log(body);
});
} else {
console.log('Error retrieving page: ' + res.statusCode);
}
}
);
Please send your suggestions for improvements or updates.
This script is roughly based upon Luka Pusic's PHP script: http://360percents.com/posts/php-random-user-agent-generator/
A refactored version in PHP is available on GitHub at: https://raw.github.com/mwhite/random-uagent/
MIT License
FAQs
Randomly generates User-Agent strings based on actual usage statistics from Wikimedia.
The npm package modern-random-ua receives a total of 2,457 weekly downloads. As such, modern-random-ua popularity was classified as popular.
We found that modern-random-ua demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.