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

@gdjiami/cli

v1.3.8

Published

CLI for build front end project.

Readme

CLI

Getting Started

CLI for build Typescript & React App jm-cli 是 mygzb 前端团队使用的项目运行和构建工具。提供了高性能, 强团队编码规范, 约定大于配置的构建环境. 可以让开发者更专注于业务的开发, 增强项目的可维护性.

安装

yarn global add @gdjiami/cli
# or
npm i -g @gdjiami/cli

jm help

jm-cli 支持在全局模式调用,也支持作为项目的依赖调用。我们推荐后者,因为他和项目是绑定版本的,不会应该版本不兼容而无法运行。

创建项目

jm create my-app

上面的命令将创建一个默认的项目。 项目结构如下:

my-app
├── README.md
├── node_modules
├── package.json
├── yarn.lock
├── global.d.ts
├── tsconfig.json
├── tslint.json
├── .gitignore
├── .env
├── .env.production
├── .env.development
├── public
└── src
    ├── layouts
    |   └── layout.pug
    ├── css
    |   └── ...
    ├── components
    |   └── ...
    ├── containers
    |   └── ...
    ├── admin.pug
    ├── admin.tsx
    ├── index.pug
    └── index.tsx

jm-cli 天然支持多页应用,这里的 admin.pug 和 index.pug 就是两个应用入口。jm-cli 会搜索与它们同名的 Typescript 入口文件。 项目结构的具体详情将在 Folder Structure 中说明。现在可以打开项目目录运行:

cd my-app

NPM Scripts

新创建的项目会内置以下命令

start

在开发服务器中运行,默认运行在 8080 端口,在启动成功后会自动开发默认浏览器.

build

编译生产环境包,资源将输出到 dist 目录

serve

运行生产环境包。这个命令会采用和 start 一样的配置(例如端口和代理配置)来运行服务器,方便测试生产环境包.

analyze

对 webpack 的生产环境包构建进行分析,方便开发者对应用进行拆包优化.

License

jm-cli is open source software licensed as MIT.

1.3.8 稳定版本介绍

此版本支持远程组件(资源)的编译模式,在业务项目的 package.json 中,通过 jm 配置远程组件模式和构建输出目录:

{
  "jm": {
    "remoteResource": {
      "enabled": true,
      "loadRcComponentEntries": ["backstage", "admin"]
    },
    "externals": {
      "react": "React",
      "react-dom": "ReactDOM",
      "mobx": "mobx",
      "moment": "moment",
      "@gzbapp/jm-rc-components": "JmRcComponents"
    },
    "outputPath": "dist"
  }
}

| 配置项 | 功能与默认值 | | --- | --- | | remoteResource.enabled | 开启远程地址探测和资源初始化,业务入口等待初始化结束后执行。默认 true;设为 false 可关闭 CLI 注入的探测、加载和等待逻辑。 | | remoteResource.loadRcComponentEntries | 需要加载远程组件及样式的页面入口名,不带文件后缀。默认 ["backstage", "admin"];其他入口仍会探测并加载公共依赖。 | | externals | 将指定依赖排除出业务包,改为读取远程脚本提供的全局变量;启用远程加载不会自动生成这些映射。 | | outputPath | 生产构建输出目录,相对路径以项目根目录为基准。默认 dist,jm serve 也从该目录读取产物。 |

  • 自行配置 remoteResource 时请同时明确填写 enabled 和入口列表,子字段不会自动补齐默认值。
  • 修改配置后重新运行 jm start,或执行 jm build 重新构建,无需额外的远程模式启动命令。
  • 本版本还增加了 react-sortablejs 产物的专用 Babel 转译规则,自动生效,无需配置。

远程组件仍按正常方式导入,构建时通过上述映射读取 window.JmRcComponents,而不是将组件实现打进业务包:

import { Button } from '@gzbapp/jm-rc-components'
  • 请从组件库包入口导入,不要深路径导入或通过 importPlugin 将该包改写为按需路径,否则不会命中上面的精确映射;组件样式由远程模式加载,无需再导入本地组件库样式。
  • externals 对业务构建全局生效,不只针对列表中的页面。关闭远程模式时,也应移除相应映射,恢复本地打包,或自行提供这些全局依赖。