@tinyfe/device
TypeScript icon, indicating that this package has built-in type declarations

0.0.10 • Public • Published

device

判断浏览器的类型

Usage

import {
  isMobile,
  isIos,
  isAndroid,
  isChrome,
  isSafari,
  isEdge,
  isFirefox,
  isIPhoneX,
  judgeDevice,
  getAgent,
} from '@tinyfe/device';

// navigator window 都不存在的时候返回 null
// 否则 navigator.userAgent || navigator.vendor || (window as any).opera
getAgent();

// fn: agent => boolean
judgeDevice(fn);

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.10
    1
    • latest

Version History

Package Sidebar

Install

npm i @tinyfe/device

Weekly Downloads

1

Version

0.0.10

License

MIT

Unpacked Size

12.3 kB

Total Files

47

Last publish

Collaborators

  • rain120