@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

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.2.31bundle
0.2.21latest
0.1.41systemjs

Version History

VersionDownloads (Last 7 Days)Published
0.2.31
0.2.21
0.2.11
0.2.01
0.1.51
0.1.41
0.1.21
0.1.11
0.1.01

Package Sidebar

Install

npm i @siyuan-community/zhi-device

Weekly Downloads

9

Version

0.2.2

License

GPL

Unpacked Size

21 kB

Total Files

15

Last publish

Collaborators

  • zuoqiu
  • terwer-org
  • leolee9086