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

0.2.2 • Public • Published

zhi-lib-device

auto check environment whether in browser, browser extension, electron, node and more

Usage

import { DeviceDetection, BrowserUtil } from "@siyuan-community/zhi-device"

console.log("isInBrowser=>", BrowserUtil.isInBrowser)

const deviceType = DeviceDetection.getDevice()
console.log("deviceType=>", deviceType)

// supported platforms
// Mobile
// Siyuan_Widget
// Siyuan_NewWindow
// Siyuan_MainWindow
// Chrome_Extension
// Chrome_Browser
// Node

Deps

## Congregations! zhi-lib-device need no deps, it is just pure js code 🎉

Dev

nx dev zhi-lib-device

Build

nx build zhi-lib-device

Test

Execute the unit tests via vitest

nx test zhi-lib-device

Publish

nx publish zhi-lib-device --ver=0.0.1 --tag=latest

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i @siyuan-community/zhi-device

      Weekly Downloads

      0

      Version

      0.2.2

      License

      GPL

      Unpacked Size

      21 kB

      Total Files

      15

      Last publish

      Collaborators

      • zuoqiu
      • terwer-org
      • leolee9086