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

nikou-node

v1.0.0

Published

Nikou OPS CLI 工具

Readme

Nikou CLI 安装与使用指南

Nikou CLI 提供 oc / nb / am / nb-init / project-info 等一系列发布与运维脚本,现已发布到 npm,支持一行指令完成安装。

一键安装

npm install -g nikou-node

安装过程中会自动执行 postinstall 脚本,设置可执行权限并写入全局 Git Hook。安装完成后可以直接运行以下命令:

oc -h
nb -h
am -h
nb-init
project-info path

提示:首次安装后依旧建议执行一次 nb-init,用于配置 OPS 所需的账号、插件以及 token。后续若需重新配置,也可单独运行 nb-init

升级 / 卸载

  • 升级到最新版本:npm update -g nikou-node
  • 卸载 CLI:npm uninstall -g nikou-node

升级后如需刷新 OPS 配置,可再次执行 nb-init

开发者调试

若需要在本地调试源码,可继续使用传统方式:

  1. 拉取仓库并安装依赖

    git clone https://gitee.com/vangelisx/nikou-node.git
    cd nikou-node
    npm install
  2. 赋予入口脚本执行权限并进行本地调试

    chmod +x router.js
    node router.js nb --help
  3. 如需手动全局链接,可执行:

    sudo ln -sf $(pwd)/router.js /usr/local/bin/oc
    sudo ln -sf $(pwd)/router.js /usr/local/bin/nb
    sudo ln -sf $(pwd)/router.js /usr/local/bin/am
    sudo ln -sf $(pwd)/router.js /usr/local/bin/nb-init

常见问题

  • am 命令需要在 PATH 中可执行,若通过全局 Hook 调用可直接使用 /usr/local/bin/am 等绝对路径。
  • 如果在 push 时希望在 am 失败后中断,可在 pre-push 钩子中增加 am || exit 1
  • project-info pull 在 npm 全局安装模式下不会直接修改 npm 包,若需升级请执行 npm update -g nikou-node

旧版安装脚本(可选)

依然可以使用历史脚本完成 git 克隆与链接操作:

node -e "const https=require('https');const fs=require('fs');const {tmpdir}=require('os');const path=require('path');const {pathToFileURL}=require('url');const url='https://gitee.com/vangelisx/nikou-node/raw/main/bin/init.js';const tmp=path.join(tmpdir(),'nikou-init-'+Date.now()+'.mjs');https.get(url,res=>{if(res.statusCode!==200){console.error('下载失败: '+res.statusCode);res.resume();process.exit(1);}const chunks=[];res.on('data',c=>chunks.push(c));res.on('end',()=>{fs.writeFileSync(tmp,Buffer.concat(chunks));import(pathToFileURL(tmp).href).then(mod=>{const fn=mod.init||mod.default;if(typeof fn!=='function'){throw new Error('脚本未导出 init 方法');}return fn();}).then(()=>{},err=>{console.error(err);process.exit(1);});});}).on('error',err=>{console.error(err);process.exit(1);});"

执行前可设置 NIKOU_INSTALL_DIR 变量以指定安装目录。除非有特殊需求,推荐优先使用 npm install -g nikou-node