Security News
PyPI Introduces Digital Attestations to Strengthen Python Package Security
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
real-user-agent
Advanced tools
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 with a gist, updated in the build process. A simple local cache, invalidated every 2 hours, prevents extra requests. A data cap is implemented in the request. There is a fallback string in case the data is corrupt or host is unreachable.
const userAgent = require('real-user-agent');
// most common user-agent string
const ua = await userAgent();
// array of top 10 most common user-agent strings
const topTen = await userAgent.all();
// round robin top 10 most common user-agents
const randomUA = await userAgent.cycle();
const anotherUA = await userAgent.cycle();
// 5th most common user-agent
const fifth = await userAgent.cycle(4);
// random user-agent
const randomUA = await userAgent.cycle(Math.random());
const request = require('request');
const userAgent = require('real-user-agent');
request({
url: 'https://api.github.com/repos/fijimunkii/real-user-agent',
headers: {
'user-agent': await userAgent()
}
});
fijimunkii
This project is licensed under the ISC License - see the LICENSE file for details.
FAQs
get a real user-agent string sourced from top 10 current
The npm package real-user-agent receives a total of 3 weekly downloads. As such, real-user-agent popularity was classified as not popular.
We found that real-user-agent 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.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.