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

track-proxy-hxm

v1.0.20

Published

track proxy module

Downloads

1

Readme

Dispatch center

调度中心

项目说明

  • 项目目录结构
+-build                       # 打包构建配置
+-config                      # 项目配置
+-dist                        # 构建打包目录
+-lib                         # 后端代码
| +-config                    # 后端配置
| +-common                    # 后端公共代码
| | +-config                  # 公共模块配置
| | +-services                # 公共服务
| | +-utils                   # 公共工具方法
| +-api-v1                    # HTTP 接口控制器,主要逻辑
| +-utils                     # 工具集合
| +-routes.js                 # 后端路由
+-logs                        # 日志
+-node_modules                # node 模块
+-test                        # 单元测试
| +-api-v1                    # 接口测试定义
|
+-gulpfile.js                 # gulp 入口
+-package.json                # 后端依赖库描述文件
+-server.js                   # 服务启动入口

node_modules 目录下的包要通过 npm install 安装

环境依赖

使用方法

根据 package.json 下载相应包

cd 到项目目录
npm install

运行开发服务

npm start

含前端的项目将用浏览器打开 http://[服务器ip]:[服务监听端口 + 1000]

运行开发服务调试模式

执行

npm run debug

用 Chromium-based 浏览器打开 chrome://inspect,点击 Configure,输入 [服务器ip]:[服务监听端口 + 2000],点击 Done 保存,即可选择要调试的服务

接口单元测试

npm test [接口测试用例]

npm test api-v1/user/manage

提交版本与构建

  1. 修改 package.json 中的版本号

  2. 生成 CHANGELOG.md

    npm run changelog
  3. 提交并创建 tag

    git commit -m "v[版本号]"
    git push
    git tag v[版本号]
    git push --tag
  4. 构建发行包

    npm run build

    项目目录下的 dist/dispatch-center-[版本号].tar.gz 为发行包

部署到 CentOS 说明

CentOS 版本:CentOS 7.x

安装 gcc, g++, openssl, python(要求2.6或2.7版本):

yum install gcc gcc-c++ openssl-devel

安装 Node.js

wget https://npm.taobao.org/mirrors/node/latest/node-v8.11.1-linux-x64.tar.gz
tar -xzvf node-v8.11.1-linux-x64.tar.gz
mv node-v8.11.1-linux-x64 /dispatch-center/node

修改 /etc/profile, 修改以下内容

# Path manipulation
if [ "$EUID" = "0" ]; then
    pathmunge /usr/sbin
    pathmunge /usr/local/sbin
else
    pathmunge /usr/local/sbin after
    pathmunge /usr/sbin after
fi

# 增加下面这行
pathmunge /dispatch-center/node/bin

执行

source /etc/profile

安装 pm2

 npm install pm2@latest -g

注意:详细使用可参考 pm2 官网

内容为

部署平台发行包

复制发行包 dispatch-center-[版本号].tar.gz 到操作系统

tar zxvf dispatch-center.tar.gz -d dispatch-center

访问路径 http(s)://[服务器ip]:[服务监听端口]