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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@nioh/cli

v1.0.0

Published

company fe cli for fe project development in private ecosystem

Readme

Z-CLI Company Front-end Command Line Tool

Install

npm i -g @tool/z-cli --registry=http://npm.zkh360.com

Quick Start

创建项目
- 创建项目,appname 必填项
$> z create <appname>

- 选择模板,nodejs 项目选择 koa,web 端选择其他
$> select one skeleton for init project (Use arrow keys)
  ❯ koa - server
    vue-admin - client
    common - client-side common skeleton
    react - client-side react basic skeleton

- 确认,将会生成 appname 的文件夹,并拉取远程模板
$> are u sure?(Y/n)

- 参数模式 -t, --template
$> z create demo -t boss-admin
$> z create demo --template boss-admin
本地开发
- 本地开发
$> z serve

- 是否开启前端热加载模式
$> switch hot dev mode on? (Y/n) 

-开启后,将需要选择一个浏览器端项目
$>  select static project to runtime develop
    ❯ home 
      vue 

// 确认后,将启动本地服务

- 参数模式 -w, --watch
$> z serve -w home

- 参数模式 -s, --server-only, 仅运行服务端代码
$> z serve -s
添加浏览器端项目,仅针对针对初始化项目是 koa 类型的
- 添加项目
$ z add

- 选择一个浏览器端模板
$> select skeleton for static project (Use arrow keys)
  ❯ vue-admin - client 
    common - client-side common skeleton 
    react - client-side react basic skeleton 

- 输入项目名称
$> input project name

- 参数模式 -t --template
$> z add -t react
前端上传
$ z upload

> 特殊定制模式

参数:-c, --customized-flow, 该模式仅针对由 z-cli 创建的项目, 不适用其他使用场景
$ z upload -c

> 普通模式

参数:-t, --target <target>
$ z upload -t ./demo.png

参数:-m, --remote-path <path>
$ z upload -m demo

参数:-u,--username <username>
$ z upload -u demo

参数:-p, --password <passowrd>
$ z upload -p demo123

注意:

z-cli 生成项目启用静态域资源, 生效环境:生产

  • 在 package.json 需要配置 remoteStaticCategory 字段,标示远程存放目录
  • 单页应用需要设置 dynamic publicPath,保证资源加载正确
  • 在上下文中 设置 ctx.state.useRemoteResource 开关,并设置为 true

设置 dynamic publicPath

1. 在 view 视图 html 中,绑定全局变量

...
<script>
  this.RES_PUBLIC_PATH = '{{ resUrl }}'
</script>
...

2. 在 webpack 设为 entry 的入口 js 中,添加

...
__webpack_public_path = window.RES_PUBLIC_PATH // eslint-disable-line
...
前端编译
$ z build [static project]
配置
$ z config

TODO