npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@micro-app/core

v0.5.0

Published

[Core] Pluggable micro application framework.

Readme

Micro APP Core

Pluggable micro application framework.

基于webpack多入口的多仓库业务模块开发的插件应用框架核心库.

Github Actions Coveralls Coverage Status NPM Version NPM Download

Install

yarn add @micro-app/core

or

npm install -D @micro-app/core

Usage

在项目 根目录 初始化创建一个 micro-app.config.js 文件

npx micro-app init

micro-app.config.js 配置文件进行编辑

module.exports = {
    name: '@micro-app/demo',
    description: '',
    version: '0.0.1',
    type: '', // type 类型

    staticPath: '', // String | Array

    entry: { // 入口
        main: './test/index.js',
    },

    // htmls: [ // 输出模版配置
    //     {
    //         template: './test/index.js',
    //     },
    // ],

    alias: { // 别名配置
        api: '',
        config: {
            link: '',
            description: '配置',
        },
        service: {
            link: '',
            description: '接口',
            type: 'server',
        },
    },

    strict: true, // 严格强依赖模式

    micros: [ 'test' ], // 被注册的容器

    plugins: [ // 自定义插件
        // [{
        //     id: 'test',
        //     description: '这是test',
        //     link: __dirname + '/test/testPlugin',
        // }, {
        //     a: 1,
        // }],
    ],
};

package.json 中加载其他模块, 例如

    "dependencies": {
        "@micro-app/test": "git+ssh://[email protected]/micro-app.git#test"
    },

项目中使用共享接口

const api = require('@micro-demo/api');

Plugins 扩展

首先在 micro-app.config.js 中注册插件

plugins: [
        [ // 1
            {
                id: 'test', // 插件 id
                description: '这是test', // 插件描述
                link: __dirname + '/test/testPlugin.js',  // 插件地址
            }, { // 注册入的 opts
                a: 1,
            }
        ],
    ],

插件文件 testPlugin.js

文件必须返回一个方法.

module.exports = function(api, opts) {
    console.log(opts);
    api.onInitDone(item => {
        console.log('init Done', item);
    });
    api.onInitDone(() => {
        console.log('init Done2', api.getState('webpackConfig'));
    });
    api.onPluginInitDone(item => {
        console.log('onPluginInitDone', item);
    });
};

内置部分插件提供的 api 方法

可通过如下命令进行动态查看

npx micro-app show methods

以提供的方法如下, System Build-in 为内置方法

╰─➤  npx micro-app show methods
  Plugin Methods:
     * onPluginInitDone            ( System Build-in )
     * beforeMergeConfig           ( System Build-in )
     * afterMergeConfig            ( System Build-in )
     * onInitWillDone              ( System Build-in )
     * onInitDone                  ( System Build-in )
     * modifyCommand               ( System Build-in )
     * onRunCommand                ( System Build-in )
     * modifyCommandHelp           ( System Build-in )

其他

已支持的终端命令行

╰─➤  npx micro-app help


  Usage: micro-app <command> [options]


  Commands:
      * show       ( show alias & shared list, etc. )
      * check      ( check all dependencies. )
      * version    ( show version )
      * start      ( runs server for production )
      * serve      ( runs server for development )
      * build      ( build for production )
      * update     ( update package.json )
      * deploy     ( sync commit status. )


  run micro-app help [command] for usage of a specific command.

展示所有容器

npx micro-app show micros

展示所有前端共享接口

npx micro-app show alias

展示所有全局共享接口

npx micro-app show shared