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

amos-plugin-cli

v1.2.0

Published

plugin cli

Readme

amos-plugin-cli

author

ilex.h

描述 descr

采用 cli 安装插件

Install

npm install -g amos-plugin-cli

配置信息 config

  • 采用独立的pluginrc进行配置

    .pluginsrc

# 插件服务器站点
amos_plugin_site=http://localhost:3333/plugins
# 插件安装之后存储位置,项目位置
amos_plugin_dir=/src/plugin
# 插件全路径
amos_plugin_path=/src/plugin/myplugin/myplugin.zip
# 插件缓存目录
amos_plugin_cache=E:/temp/plugins/amos-plugins
# 插件缓存目录
plugin_cache=E:/temp/plugins
# 插件包后缀名 默认 zip(与服务器中存储的插件后缀名保持一致)
amos_plugin_ext=rar
  • 采用配置node环境 node env [windows]
set AMOS_PLUGIN_EXT=zip
set AMOS_PLUGIN_SITE=http://localhost:3333/plugins
set AMOS_PLUGIN_DIR=/src/plugin
set AMOS_PLUGIN_PATH=/src/plugin/myplugin/myplugin.zip
  • 采用配置node环境 node env [linux]
export AMOS_PLUGIN_EXT=zip
export AMOS_PLUGIN_SITE=http://localhost:3333/plugins
export AMOS_PLUGIN_DIR=/src/plugin
export AMOS_PLUGIN_PATH=/src/plugin/myplugin/myplugin.zip
  • 采用package.json
{
  "amosPluginConfig": {
    "pluginExt": "zip",
    "pluginSite": "http://localhost:3333/plugins",
    "pluginDir": "/src/plugin",
    "pluginPath": "/src/plugin/myplugin/myplugin.zip"
  }
}
  • 采用 cli使用
# 自定义扩展名
amos-plugin hello --ext zip
# 自定义插件站点
amos-plugin hello --amos-plugin-site http://localhost:3333/plugins
# 自定义插件安装目录
amos-plugin hello --amos-plugin-dir /src/plugin
# 自定义插件全路径
amos-plugin hello --amos-plugin-path /src/plugin/myplugin/myplugin.zip

使用

  • cli
# 查看版本
amos-plugin -v
# 查看帮助信息
amos-plugin -h
# 创建plugin 初始工程
amos-plugin -t
# 打包plugin 生成tarball
amos-plugin -p
# 安装 hello 插件
amos-plugin hello
# 自定义插件配置信息
amos-plugin hello --ext zip --amos-plugin-site http://localhost:3333/plugins
  • generate plugin

    project:

  /example #[测试]
  /server #[测试api]
  /src #[源码]
    index.js
    customRoutes.js #[可选]
    reducer.js #[可选]
    package.json
    plugin.descr.json
    readme.md
    webpack.config.js
    -- other setting
  • publish plugin

    files:

    • index.plugin.js: 【plugin entry, must require】
    • customRoutes.plugin.js: 【plugin custom routes】
    • extraEntry.plugin.js: 【plugin extra entry】
    • reducer.plugin.js: 【plugin reducer】
    • package.json: 【plugin pkg file】
    • plugin.descr.json: 【plugin description file】
    • readme.md: 【plugin description】
    • lib: 【plugin dir】
# 输出 xxx.zip,目前暂支持 输出为zip格式
amos-plugin -p

mf 脚本说明

# 执行拷贝 mf 文件
amos-plugin --mf
# or
amos-plugin -m
# 拷贝之前,先删除已有的 mf
amos-plugin --mf --mf-r

mfrc 配置文件

v1.1.0 新增 mf 拷贝

支持的配置文件 .mfrc.mfrc.json.mfrc.js, 推荐使用 json

采用 json 的方式

{
  "dir": "website/mf_lib2", // 需要拷贝到的目录,相对于当前 process.cwd() 位置
  // mf 配置路径
  // pkg 表示包含 mf 模块的 npm 包
  // mf 代表 mf 所在的目录,相对于 npm 包根目录
  // entry 用于标识 mf 模块中提供的入口文件,该配置项主要用于采用 `require.resolve` 方式获取根 mf 目录
  "list": [
    { "pkg": "amos-framework", "mf": "amosaf_dist", "entry": "remoteEntry.js" }
  ]
}

采用 js 的方式

module.exports = {
  dir: "website/mf_lib2", // 需要拷贝到的目录,相对于当前 process.cwd() 位置
  // mf 配置路径
  // pkg 表示包含 mf 模块的 npm 包
  // mf 代表 mf 所在的目录,相对于 npm 包根目录
  // entry 用于标识 mf 模块中提供的入口文件,该配置项主要用于采用 `require.resolve` 方式获取根 mf 目录
  list: [
    { pkg: "amos-framework", mf: "amosaf_dist", entry: "remoteEntry.js" }
  ]
}

注意: 仅支持 native 的方式使用,不支持 global 方式使用。

why?

通过获取 remoteEntry.js 脚本位置,获取指定 pkg 的 mf 目录,从而进行复制 mf 目录。

umd 脚本说明

# 执行拷贝 umd 文件
amos-plugin --umd
# or
amos-plugin -u
# 拷贝之前,先删除已有的 umd
amos-plugin --umd --umd-r

umdrc 配置文件

v1.1.3 新增 umd 拷贝

支持的配置文件 .umdrc.umdrc.json.umdrc.js, 推荐使用 json 或者 js 方式

采用 js 的方式 (json 格式相同)

module.exports = {
  dir: 'website/umd_lib', // 需要拷贝到的目录,相对于当前 process.cwd() 位置
  // umd 配置路径
  // pkg 表示包含 umd 模块的 npm 包
  // umd 代表 umd 所在的目录,相对于 npm 包根目录
  list: [
    { pkg: 'react', umd: 'umd' },
    { pkg: 'react-dom', umd: 'umd' },
    { pkg: 'amos-react-router', umd: 'umd' },
    // { pkg: 'prop-types', umd: '' },
    // 仅 copy 文件
    { pkg: 'prop-types', umd: '', files: ['prop-types.js', 'prop-types.min.js'] },
    { pkg: 'amos-framework', umd: 'dist' },
    { pkg: 'amos-antd', umd: 'dist' },

    { pkg: 'echarts', umd: 'dist' },
    { pkg: 'codemirror', umd: 'lib' },
    { pkg: 'quill', umd: 'dist' },

    { pkg: 'brace', umd: '' },
    { pkg: 'tinymce', umd: '' },

    { pkg: 'monaco-editor', umd: 'min' },
    { pkg: 'base-r3d', umd: 'build' },
    { pkg: 'xgplayer', umd: 'dist' },
  ],
  // 用于配置 webpack externals
  externals: {
    'react': 'React',
    'react-dom': 'ReactDOM',
    'amos-framework': 'amosframework',
    'amos-react-router': 'ReactRouter',
    'prop-types': 'PropTypes',
    'amos-antd': 'amosantd',
    'monaco-editor': 'monaco',

    'echarts': 'echarts',
    'codemirror': 'CodeMirror',
    'tinymce': 'tinymce',
    // ace editor
    brace: { commonjs: 'brace', commonjs2: 'brace', amd: 'brace', root: 'ace' },

    'base-r3d': 'B3D',
  },
  // 用于配置 webpack 动态加入 externals 脚本
  // 可以手动直接加入到 html 中,也可以采用 webpack 插件,插入到指定的 html 文件中
  // 也可以代码执行过程中,动态插入脚本
  scripts: [
    "react/react.production.min.js",
    "react/react-dom.production.min.js",
    "amos-react-router/ReactRouter.min.js",
    "prop-types/prop-types.min.js",

    "amos-framework/amosframework.min.js",
    // "amos-framework/amosframework.min.css",

    "amos-antd/amosantd.min.js",
    // "amos-antd/amosantd.min.css",


    "echarts/echarts.min.js",

    "codemirror/codemirror.js",
    // "codemirror/codemirror.css",

    "quill/quill.min.js",
    // "quill/quill.core.css",
    // "quill/quill.bubble.css",
    // "quill/quill.snow.css",

    "brace/index.js",
    "tinymce/tinymce.min.js",
    "base-r3d/b3d.umd.js",
    "xgplayer/index.js",
  ]
}

changelog

  • 2024-3-22 v1.1.5 * umd loader can copy single files

  • 2021-8-12 v1.1.3 + umd loader amos-plugin --umd --umd-r

  • 2018-10-23 v1.0.11 + tpl: amos-plugin -t

Lecense

MIT