npm.io
0.0.5 • Published 5 years ago

@mudas/env

Licence
MIT
Version
0.0.5
Deps
1
Size
27 kB
Vulns
0
Weekly
0

env

npm version

A plugin that supports Vue to dispatch global events.

Setup

install:

npm i @mudas/env -S

You need to add configuration for vue-cli to correctly translate the es module in node_modules:

// vue.config.js:
module.exports = {
    transpileDependencies: [
      '@mudas/*' // all of node_module for '@mudas'
    ]
}

Usage

import { parsingUserAgentEnv, parsingAppletEnv, parsingURLParams } from '@mudas/env';

// Applet ENV
parsingApplet({ ...parsingUserAgent(), ...parsingURLParams() }).then((data) => {
    // ... return types/EnvHolderType & { wechatApplet:boolean, alipayApplet:boolean }
});

Keywords