Socket
Socket
Sign inDemoInstall

@miapp/dpm

Package Overview
Dependencies
Maintainers
5
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@miapp/dpm

Dynamic Plugin Manager


Version published
Weekly downloads
2
decreased by-50%
Maintainers
5
Weekly downloads
 
Created
Source

小程序工具 ~ dpm

Dynamic Plugin Manager

使用

  1. 安装 yarn

    tnpm install yarn -g
    
  2. 添加依赖

    ayarn add @miapp/dpm
    
  3. 应用

    import {
      goto, 
      loader
    } from '@miapp/dpm';
    
    // 跳转动态插件页(自动异步加载插件,成功后跳转指定插件页)
    goto({
      name: 'pluginName',
      id: 'appid',
      page: 'pageName?a=1&b=2',
    });
    
    // 加载单个动态插件
    const pluginPromise = loader({
      name: 'store',
      id: '2021001138613148',
    }).then(_ => {
        //...
      })
      .catch(e => {
        //...
      });
    
    // 加载多动态插件并使用场景
    const plugins = loader([
      {
        name: 'store',
        id: '2021001138613148',
      }
    ]);
    if(plugins.store){
      plugins.store.then(({name, id, page} = plugins) => {
        goto({
          name,
          id,
          page,
        });
      });
    }
    

FAQs

Package last updated on 16 Dec 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