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

qxf

v1.3.15

Published

FE Node development solution

Downloads

244

Readme

qunar node 开发解决方案

让你只专注在业务和展现

项目地址:http://gitlab.corp.qunar.com/fed/qxf

本地安装

npm install qxf -g --registry=http://npmrepo.corp.qunar.com

其他包依赖公司内部的npm源,你需要先安装qnpm,安装方式

通过alias命令

alias qnpm="npm --registry=http://npmrepo.corp.qunar.com --cache=$HOME/.npm/.cache/qnpm --userconfig=$HOME/.qnpmrc"

或者在~/.bash_profile~/.zshrc中增加如下配置:

# alias for qnpm
alias qnpm="npm --registry=http://npmrepo.corp.qunar.com --cache=$HOME/.npm/.cache/qnpm --userconfig=$HOME/.qnpmrc"

然后运行:

source ~/.bash_profile # base环境
source ~/.zshrc # zsh环境

命令支持

Qxf 使用说明
===========================
qxf init 初始化一个项目
qxf dev 启动项目本地服务
qxf initserver [-w <webappFoler> -s <serviceName>] 服务器目录和服务初始化
qxf initschema qdr发布系统schema初始化
qxf remote -r <serverlist> -c <remoteCommand> 远程执行命令
qxf sync [server] 同步文件到服务器

如何创建一个qxf工程

1. 在项目目录里执行 `qxf init`
2. 运行 `qnpm install`
3. 运行 `bin/dev`

服务器安装

  1. 新申请的服务器,在申请服务器时可以选择预装QXF,这样就不用到服务器上做任何安装了

  2. 如果是原来的服务器或者申请的时候忘了选择预装,需要执行一下步骤安装:

    1. ssh 登录服务器
    2. 运行 sudo yum install nodejs
    3. 运行 sudo npm install qxf -g --registry=http://npmrepo.corp.qunar.com

*执行第2步,如果原来的服务器上已经安装过 node的其他版本,需要先将之前的版本卸载,如果是采用sudo yum install q-node 安装的,卸载方法为运行 sudo yum remove q-node -y

服务器web环境配置

配置web环境有如下三种方式(推荐使用第3种方式配置):

  1. ssh 登录服务器,执行 sudo qxf initserver按照提示输入所需参数,或者执行 sudo qxf initserver -w <web目录名称> -s <service名称>

  2. 在本地可以ssh登录到服务器的终端执行

     qxf remote -r '<服务器列表>' -c 'sudo qxf initserver -w <webappFolder> -s <serverName>'
  3. 按照说明配置工程里的package.json中的schema内容,在本地可以ssh登录到服务器的终端执行

     qxf initserver --config

服务器列表支持格式:

l-home[m-n].fe.cn5
l-home[x,y,z].fe.cn5
l-home[m-n].fe.cn5,l-home[x,y,z].fe.cn5,...

包含模块

qzz版本号 @qnpm/q-version


使用

var qversion = require('@qnpm/q-version');
// 初始化版本号
qversion.parse(path.join(__dirname, 'refs')); // 参数为ver目录所在路径

模板 @qnpm/q-template


使用

var qtemplate = require('@qnpm/q-template');

// 设置模板引擎
qtemplate(app, {
  views: __dirname + "/views", // 总模板目录
  layouts: 'layouts', // layout模板目录,默认views/layouts
  versions: qversion.versions()
});

模板使用详尽说明及接口

日志 @qnpm/q-logger

日志组件支持多进程工程,由主进程统一负责记录日志,支持不同的路由记录不同的日志文件,配置如下:

{
    logFiles: [
        {
            type: 'track', // 名称
            route: ['/track.htm', '/timetrack.htm'], // 路由,支持express风格路由
            appenders: [ // log4js appenders配置
                {
                    "type": "file",
                    "filename": "track.log",
                    "category": "track",
                    "level": "LOG",
                    "layout": {
                        "type": "messagePassThrough"
                    }
                }
            ]
        }
    ]
}

使用

初始化

主进程:

logger.init("master", [option]);
// [option]为多日志文件配置,如上

工作进程:

var logger = require('@qnpm/q-logger');
logger.init('worker', [option]); // 初始化日志系统

接口:

logger.error(); // 记录错误
logger.info(); // 记录普通日志

异常 @qnpm/q-exception


使用

var exception = require('@qnpm/q-exception');

exception.init(logger); // 初始化异常捕获系统,需传入logger用作错误记录

// 捕获异步异常,放到所有中间件前面
app.use(exception.catchAsync());

// 捕获同步异常,放到所有中间件后面
app.use(exception.catchSync());

healthcheck @qnpm/q-healthcheck


使用

var healthcheck = require('@qnpm/q-healthcheck');
// healthcheck 发布时有用
healthcheck.check(app, path.join(__dirname, 'healthcheck.html')); // 传入healthcheck的路径

监控 @qnpm/q-monitor


使用

var qmonitor = require('@qnpm/q-monitor');
qmonitor.addCount('监控指标名');
qmonitor.addTime('监控指标名', '时间');

多进程 @qnpm/q-multiprocess


使用

 var opts = {
  // CPU核数
  numCPUs: require('os').cpus().length,
  // 端口
  port: app.get('port'),
  // 子进程收到父进程消息后父进程执行方法
  workerMessage: function (msg, workers) {

  },
  ready: function(workers) {

  }
};

multiprocess.listen(app, opts);