# user-agents-generator

> A Minimal Package to Generate unlimited user agents

Latest version **1.0.2** (published 2023-02-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install user-agents-generator
pnpm add user-agents-generator
yarn add user-agents-generator
bun add user-agents-generator
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2023-02-22 |
| First published | 2023-02-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 9 |
| Author | DropOutLab |
| Maintainers | shaonkabir8, dropoutlab, imrandu |
| Keywords | user-agents, nodejs, javaScript, user, agent, changer, unique, random, unlimited, agents, generator, chrome, firefox, safari, mac os, linux, windows, puppeteer, playwright, automation |

## Links

- npm: https://www.npmjs.com/package/user-agents-generator
- Repository: https://github.com/dropoutlab-dev/user-agents-generator
- Homepage: https://github.com/dropoutlab-dev/user-agents-generator#readme
- Issues: https://github.com/rdropoutlab-dev/user-agents-generator/issues
- npm.io page: https://npm.io/package/user-agents-generator

## Alternatives

- [@snazzah/davey](https://npm.io/package/@snazzah/davey.md) — 1.5M weekly downloads
- [@vendure/testing](https://npm.io/package/@vendure/testing.md) — 8.3K weekly downloads
- [vue-simple-context-menu](https://npm.io/package/vue-simple-context-menu.md) — 6.6K weekly downloads
- [cypress-webpack-preprocessor-v5](https://npm.io/package/cypress-webpack-preprocessor-v5.md) — 2.1K weekly downloads
- [@backstage/plugin-catalog-backend-module-puppetdb](https://npm.io/package/@backstage/plugin-catalog-backend-module-puppetdb.md) — 1.3K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2023-02-22
- 1.0.1 — 2023-02-22
- 1.0.0 — 2023-02-21

## README

# User Agents Generator

> This is a Node.js module that provides a simple way to generate user agent strings for various web browsers and mobile devices. The generated user agents can be used in web scraping or automation scripts to mimic the behavior of real users.

## Usage

1.  Install the module in your project:

```bash
npm install user-agent-generator
```

2.  Import the module in your script:

```javascript
const userAgentGenerator = require('user-agent-generator');
```

3.  Use the module's methods to generate user agents for different browsers and devices:

```javascript
`const chromeUserAgent = userAgentGenerator.chrome();
const firefoxUserAgent = userAgentGenerator.firefox();
const safariUserAgent = userAgentGenerator.safari();
const androidUserAgent = userAgentGenerator.android();
const iosUserAgent = userAgentGenerator.ios();` 
```
4.  Pass the generated user agent string to your Puppeteer automation scripts:

```javascript

const puppeteer = require('puppeteer');
const chromeUserAgent = userAgentGenerator.chrome();
(async () => {
  const browser = await puppeteer.launch({
    headless: true,
    args: [`--user-agent=${chromeUserAgent}`]
  });
  const page = await browser.newPage();
  await page.goto('https://www.example.com');
  // your automation code here
  await browser.close();
})();
```

## API

### `userAgentGenerator.chrome()`

Generates a user agent string for the Google Chrome browser.

### `userAgentGenerator.firefox()`

Generates a user agent string for the Mozilla Firefox browser.

### `userAgentGenerator.safari()`

Generates a user agent string for the Apple Safari browser.

### `userAgentGenerator.android()`

Generates a user agent string for an Android device.

### `userAgentGenerator.ios()`

Generates a user agent string for an iOS device.

## License

This module is released under the MIT License.

---
_Source: https://npm.io/package/user-agents-generator · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
