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

universal-env

Package Overview
Dependencies
Maintainers
5
Versions
117
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

universal-env

Judge runtime environment

  • 3.2.0-1
  • npm
  • Socket score

Version published
Weekly downloads
1.2K
decreased by-61.11%
Maintainers
5
Weekly downloads
 
Created
Source

universal-env npm

Judge runtime environment

Support

browser weex miniApp wechatMiniprogram bytedanceMicroApp quickApp

Install

$ npm install universal-env --save

Usage

import { isWeex, isWeb, isMiniApp, isNode, isWeChatMiniProgram, isByteDanceMicroApp, isQuickApp } from 'universal-env';

APIS

isWeex: boolean

Checks if environment is a weex environment.

isWeb: boolean

Checks if environment is a web environment.

isMiniApp: boolean

Checks if environment is an alibaba miniprogram environment.

isWeChatMiniProgram: boolean

Checks if environment is a wechat miniprogram environment.

isByteDanceMicroApp: boolean

Checks if environment is a bytedance microapp environment.

isQuickApp: boolean

Checks if environment is a quickapp environment.

isNode: boolean

Checks if environment is a Node.js environment.

Results in each container

Note:To judge MiniProgram env in WebView, please insert JS SDK accordingly.

isMiniAppisWeChatMiniProgramisByteDanceMicroAppisQuickAppisWebisWeexisNode
Alibaba MiniApp✔️
Alibaba MiniApp WebView✔️✔️
Wechat MiniProgram✔️
Wechat MiniProgram WebView✔️✔️
ByteDance MicroApp✔️
ByteDance MicroApp WebView✔️✔️
QuickApp✔️
QuickApp WebView✔️
Weex✔️
Node✔️
Web✔️

Keywords

FAQs

Package last updated on 31 Mar 2020

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