Socket
Socket
Sign inDemoInstall

universal-user-agent

Package Overview
Dependencies
0
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    universal-user-agent

Get a user agent string across all JavaScript Runtime Environments


Version published
Weekly downloads
8.2M
increased by0.88%
Maintainers
1
Install size
7.95 kB
Created
Weekly downloads
 

Package description

What is universal-user-agent?

The universal-user-agent npm package is designed to generate user-agent strings that can be used in various environments such as Node.js, browsers, and React Native applications. It abstracts away the differences between these environments, providing a unified way to obtain a user-agent string that represents the client making HTTP requests.

What are universal-user-agent's main functionalities?

Generate User-Agent String

This feature allows you to generate a user-agent string that is appropriate for the environment your code is running in. The generated string includes information about the platform, operating system, and browser or Node.js version, depending on the execution context.

"const userAgent = require('universal-user-agent');
console.log(userAgent());"

Other packages similar to universal-user-agent

Readme

Source

universal-user-agent

Get a user agent string across all JavaScript Runtime Environments

@latest Build Status

import { getUserAgent } from "universal-user-agent";

const userAgent = getUserAgent();
// userAgent will look like this
// in browser: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:61.0) Gecko/20100101 Firefox/61.0"
// in node: Node.js/v8.9.4 (macOS High Sierra; x64)

License

ISC

FAQs

Last updated on 18 Sep 2023

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