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 🙏

© 2026 – Pkg Stats / Ryan Hefner

nitaipage-npp-cli

v1.1.3

Published

CLI tool for creating and developing NitaiPage NPP plugins

Readme

NitaiPage NPP CLI

NitaiPage NPP 插件开发的命令行工具,旨在帮助开发者快速创建和调试 NPP 插件

功能特性

  • 🚀 快速创建插件文件或商店 JSON 文件
  • 🔧 集成本地开发服务器
  • 🔍 插件元数据验证
  • 📦 插件代码压缩

安装

npm install -g nitaipage-npp-cli

使用方法

创建新插件

npplication create

# 可直接指定名称
npplication create my-plugin

# 使用别名
npplication c my-plugin

# 快速生成插件 ID
npplication c -id
# 或
npplication create --id

创建向导会提示输入以下信息:

  • 插件名称
  • 插件描述
  • 作者信息
  • 加载时机(head/body)
  • 插件类型(normal/coreNpp/translate)
  • 图标 URL(可选)
  • 截图 URL(可选)
  • 是否需要设置界面(可选)
  • 是否开启强制更新(可选)
  • 依赖项(可选)

启动开发服务器

# 使用默认端口 11123
npplication dev

# 指定端口
npplication dev --port 11124

# 使用别名
npplication d

在 NitaiPage 浏览器控制台执行显示的安装命令即可安装插件并进行调试

验证插件

# 验证当前目录的插件文件
npplication check

# 验证指定文件
npplication check --file path/to/plugin.js

验证功能会检查:

  • 元数据格式
  • 必需元数据
  • ID 格式(13位时间戳 + UUID v4)
  • 版本号格式
  • 加载时机
  • 翻译插件的语言代码(仅翻译插件)

构建插件(压缩插件)

# 构建当前目录的插件文件
npplication build

# 构建指定文件
npplication build --file path/to/plugin.js

# 使用别名
npplication b

构建功能会:

  • 压缩插件代码
  • 生成 plugin-compressed.js 文件
  • 自动验证构建结果

创建商店 JSON 文件

npplication store

# 使用别名
npplication s

插件元数据规范

NPP 插件需要在文件开头包含元数据块:

// ==Npplication==
// @name 插件名称
// @id 1234567890123_12345678-1234-4123-8123-123456789012
// @version 1.0.0
// @description 插件描述
// @author 作者名称
// @time body
// @type 
// @icon https://example.com/icon.png
// @screen https://example.com/screenshot.png
// @forced false
// @setting false
// @dependencies [`https://example.com/dep.js`:`1.0.0`]
// @associations [`https://example.com/assoc.js`:`1.0.0`]
// @translates [`https://example.com/trans.js`:`1.0.0`] or zh-CN
// ==/Npplication==

必需字段

  • @name: 插件名称
  • @id: 插件 ID(格式:13位时间戳 + UUID v4)
  • @version: 版本号(格式:数字.数字.数字,如 0.0.1)
  • @time: 加载时机(head/body)

可选字段

  • @description: 插件描述
  • @author: 作者信息
  • @type: 插件类型(normal/coreNpp/translate)
  • @icon: 图标 URL
  • @screen: 截图 URL
  • @forced: 是否强制更新(true/false)
  • @setting: 是否注册设置页面(true/false)
  • @dependencies: 依赖项列表(格式:[url:version])
  • @associations: 关联项列表(格式:[url:version])
  • @translates: 翻译语言代码(仅翻译插件必需,格式:zh-CN 或 [url:version])

商店数据格式规范

NitaiPage 商店使用 JSON 格式存储数据:

{
  "category": [
    {
      "tools": "工具",
      "style": "主题",
      "translate": "翻译"
    }
  ],
  "tools": [
    {
      "插件ID": {
        "url": "插件文件 URL",
        "screenshots": ["截图 URL1", "截图 URL2"]
      }
    }
  ],
  "style": [
    {
      "插件ID": {
        "url": "插件文件 URL",
        "screenshots": ["截图 URL"]
      }
    }
  ],
  "translate": [
    {
      "插件ID": {
        "url": "插件文件 URL"
      }
    }
  ]
}

开发工作流

  1. 创建项目

    npplication create my-plugin
    cd my-plugin
  2. 开发插件 编辑生成的 my-plugin.js 文件,实现你的插件功能。

  3. 本地调试

    npplication dev

    在 NitaiPage 控制台执行显示的安装命令。

    注意:开发服务器已配置 CORS

  4. 验证插件

    npplication check
  5. 构建压缩

    npplication build

命令参考

| 命令 | 别名 | 说明 | | ----------------------------- | ----------------- | -------------- | | npplication create <name> | npplication c | 创建新插件项目 | | npplication create --id | npplication c -id | 快速生成插件 ID | | npplication dev --port <port> | npplication d | 启动开发服务器 | | npplication check | - | 验证插件元数据 | | npplication build | npplication b | 构建插件 | | npplication store | npplication s | 创建商店 JSON 文件 |

常见问题 (Q&A)

Q: 如何更新插件?

A: 更新插件文件并增加版本号,NitaiPage 会自动检测更新。或者再次在控制台执行 installNpplication(JSUrl) 覆盖安装插件。

Q: 如何设置 CORS?

A: 开发服务器已自动配置 CORS ,无需手动设置

Q: 开发服务器端口被占用怎么办?

A: 使用 --port 参数指定其他端口,例如:npplication dev --port 11124

License

MIT

欢迎提交 Issue 和 PR!