Socket
Socket
Sign inDemoInstall

@ahmedrangel/rand-user-agent

Package Overview
Dependencies
0
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @ahmedrangel/rand-user-agent

This is an adapted version of rand-user-agent by WebScrapingAPI specifically designed for environments lacking access to server file systems (fs), such as Cloudflare Workers.


Version published
Weekly downloads
28
decreased by-42.86%
Maintainers
1
Install size
495 kB
Created
Weekly downloads
 

Changelog

Source

v2.0.14

🏡 Chore

  • release: V2.0.13 (1d51a8b)
  • Updated user-agents dataset (d263e20)

❤️ Contributors

Readme

Source

Random User Agent

This is an adapted version of rand-user-agent by WebScrapingAPI specifically designed for environments lacking access to server file systems (fs), such as Cloudflare Workers.

Installation

Run the following command in the main folder of your project:

# Using npm
npm i @ahmedrangel/rand-user-agent

# Using pnpm
pnpm add @ahmedrangel/rand-user-agent

# Using yarn
yarn add @ahmedrangel/rand-user-agent

Usage Example

import { randUA } from "@ahmedrangel/rand-user-agent";

// ...

const agent = randUA("desktop");

console.log(agent);

You can also provide a browser and an operating system in the parameters of randUA in order to filter out the user agents:

import { randUA } from "@ahmedrangel/rand-user-agent";

// ...

const agent = randUA("desktop", "chrome", "linux");

console.log(agent);

Keywords

FAQs

Last updated on 01 Apr 2024

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc