[go: up one dir, main page]

@weex-project/env

0.0.6 • Public • Published

Env

Weex get environment tool.

how to use

npm install @weex-project/env --save

example

isWeb

const Env = require('@weex-project/env')

// normal browser
Env.isWeb()

// iOS webview
Env.isWeb() && Env.isIOS()

// Android webview
Env.isWeb() && Env.isAndroid()

isApp

const Env = require('@weex-project/env')

// is my app
Env.isApp('MY_APP')

// is my app with legacy issues
Env.isApp(['MY_APP', 'MY_APP_LEGACY'])

isIOS

const Env = require('@weex-project/env')

// is ios
Env.isIOS()

isAndroid

const Env = require('@weex-project/env')

// is android
Env.isAndroid()

/@weex-project/env/

    Package Sidebar

    Install

    npm i @weex-project/env

    Weekly Downloads

    0

    Version

    0.0.6

    License

    Apache-2.0

    Last publish

    Collaborators

    • erha19
    • hanks
    • yuanyan
    • jack_pu
    • sospartan
    • fkysly
    • mr.raindrop
    • exolution
    • songsiqi
    • tancy
    • iskenhuang