Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

zhi-device

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zhi-device

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

  • 2.4.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

zhi-device

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

Usage

import { DeviceDetection, BrowserUtil, DeviceTypeEnum } from "zhi-device"

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

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

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

Deps

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

Dev

pnpm dev -F zhi-device

Build

pnpm build -F zhi-device

Api

pnpm doc -F zhi-device
pnpm md -F zhi-device

Test

Execute the unit tests via vitest

pnpm test -F zhi-device

Publish

pnpm publish -F zhi-device --tag=latest

Keywords

FAQs

Package last updated on 16 Oct 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc