0.2.2 • Published 2 years ago

@siyuan-community/zhi-device v0.2.2

Weekly downloads
-
License
GPL
Repository
github
Last release
2 years ago

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

## systemjs tag is systemjs, latest tag is esm
nx publish zhi-lib-device --ver=0.1.0 --tag=systemjs
nx publish zhi-lib-device --ver=0.1.1 --tag=latest
0.2.1

2 years ago

0.1.2

2 years ago

0.2.0

2 years ago

0.1.1

2 years ago

0.2.3

2 years ago

0.1.4

2 years ago

0.2.2

2 years ago

0.1.5

2 years ago

0.1.0

2 years ago