Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

duct-get-browser-info

sezaialkan8ISC1.0.0

A utility function to get the browser name and user agent string.

browser, user agent, browser info, detect browser, browser detection, javascript, utility, client, navigator, userAgent, web, frontend

readme

using duct-get-browser-info

A utility function to get the browser name and user agent string.

Demo

https://codeduct.com/duct-get-browser-info

duct-get-browser-info setup

npm

npm i duct-get-browser-info

Add the duct-get-browser-info package in the component you want to use after installation.

import getBrowserInfo from 'duct-get-browser-info'

ready to use

const browserInfo = getBrowserInfo();

console.log(browserInfo.browserName); //Chrome
console.log(browserInfo.userAgent); //Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) ....

Returns the personal browser name of browserName. userAgent returns the browser's user agent string.