Never Publish Malarkey

    @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);

    Keywords

    none

    Install

    npm i @tinyfe/device

    DownloadsWeekly Downloads

    15

    Version

    0.0.10

    License

    MIT

    Unpacked Size

    12.3 kB

    Total Files

    47

    Last publish

    Collaborators

    • rain120