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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@hjm100/hjm-cli

v1.1.0

Published

npm init cli

Downloads

3

Readme

hjm-cli

介绍

  1. 一个初始化项目的脚手架
  2. 目前支持
    1. npm 包的初始化 npm-init
    2. 机器人模板初始化 robot-init
  3. 以后可能作为初始化以及解放自己双手用

软件架构

.
├── bin               # 脚本运行入口
│   └── hjm           # 命令行
├── commands          # cmd命令脚本逻辑
│   ├── robot             # 机器人相关脚本文件
│   │   └── init.ts      # 命令 hjm robot:init 脚本
│   ├── npm             # npm相关脚本文件
│   │   └── init.ts      # 命令 hjm npm:init 脚本
│   └── basics.ts       # 脚本基础类
├── src                         # 源文件
│   └── index.ts
├── config                # 项目配置文件
├── doc                   # 技术文档
├── plan                  # 开发计划
├── tests                 # 测试文件
└── README.md             # 说明文件

安装教程


git clone https://gitee.com/hjmeng/hjm-cli.git   # 克隆项目到本地

cd hjm-cli                                       # 进入项目根目录

npm i                                                 # 安装包依赖

启动脚本


#------------- cmd --------------#
# 注意: 将仓库中的文件全部移动到根目录 中的路径改一下以免覆盖当前仓库文件内容
# shell.exec(`cp -R ./npm-init/ ./hjm`);    // step4: 将仓库中的文件全部移动到根目录

npm run npm:init     # 测试 hjm npm:init cmd

#------------- lint --------------#
npm run lint         # 启动lint检测

npm run lint:fix     # 启动lint修复

发布包

#------------发包前准备-------------#

# 因为项目是ts写的,所以需要将其转化成js版本在发布要不然命令不能运行

npm run build

#------------查看当前npm源的地址-------------#

npm config get registry

#------------登录npm(如果有则不用登陆)-------------#

npm set registry https://registry.npmjs.org

npm login

#------------发布包(注意package.json中的版本)-------------#

npm version patch # 更新package中的版本号 npm version 1.0.1

# npm publish
npm publish --access public  # 发布一个共有包

用法

#------------全局安装npm包-------------#

npm install @hjm/hjm-cli -g

#------------测试hjm脚本-------------#

cd 进入需要初始化的项目文件夹
# 初始化一个npm包基础项目
hjm npm:init
# 初始化一个机器人基础项目
hjm robot:init

# 初始化脚本成功

分支说明

  1. master 默认分支

  2. develop 调试分支

参与贡献

  1. Fork 本仓库
  2. 新建 Feat_xxx 分支
  3. 提交代码
  4. 新建 Pull Request