New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.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
Version published
Weekly downloads
4.3K
-12.95%
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

Rax

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