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

jd-minigame-ci

v1.2.1

Published

The jd-minigame-ci is a toolkit provided for developers of JD Mini Games. Developers can complete code upload and preview operations for JD Mini Games without the need to open the developer tools, simply by using this toolkit.

Readme

京东小游戏 CI 工具

概述

jd-minigame-ci 是为京东小游戏开发者提供的工具包。开发者无需打开开发者工具,使用工具包即可完成小程序代码的上传、预览等操作。

上传秘钥

使用工具包之前,请访问“京东小程序控制台—设置—开发设置—小游戏代码上传秘钥”获取上传秘钥。

需要注意的是,获取上传密钥权限目前仅小游戏管理员可以获取。

alt 京东小程序秘钥生成

功能

  1. 上传代码,对应小程序开发者工具的上传功能
  2. 预览代码,对应小程序开发者工具的预览功能
  3. 支持“node 脚本”和“命令行”调用方式
  4. 跨平台,支持 Windows/Mac/Linux,可用于产品集成流水线部署

安装

前提要求Node版本 18+;

npm install -g jd-minigame-ci

CLI版本获取

为确保使用最新功能和安全更新,如果检测到您的本地npm包版本落后于仓库中的最新版本,建议首先卸载本地包,随后安装最新版本。

通过以下命令可获取本地京东小游戏CLI工具版本:

jgc -v 
jgc -V

以上命令均可获取本地京东小游戏CLI工具版本。

也可以通过以下命令行:

jgc latest 

以上命令将拉取京东小游戏CLI工具在npm官方仓库最新版本,并与本地版本进行对比,提示版本对比信息。

命令行调用

创建小游戏配置文件

在游戏项目父目录或者其他目录(注意不要在当前待打包游戏的子目录)执行以下命令:

jgc config

配置成功后会在当前目录生成配置文件 jgc.config.js,配置示例如下:

module.exports = {
  "type": "game", // 包类型, 有两种类型可选:game(小游戏), plugin(插件)
  "appId": "133D26A41FB623****", // 游戏的appId 
  "requestToken": "1c0f081c18a248adbff9f****", // 游戏上传秘钥
  "entry": "./build/source", // 需要被打包的小游戏的路径 
  "versionName": "1.0.0", // 选填,版本号
  "description": "自测" // 选填,自定义备注 
}

小游戏-预览功能

预览功能主要用于开发过程中,对小游戏进行真机预览及调试。

在生成 jgc.config.js 的同级目录执行以下命令:

jgc preview

执行完上述命令后,如果一切正常,会在Termina出现二维码,

alt 预览二维码

小游戏-上传功能

上传功能用于开发者通过命令行快速将本地代码包上传至开发版本,并自动设置为体验版,返回体验版二维码。

在生成 jgc.config.js 的同级目录执行以下命令

jgc upload

alt 体验版二维码

串行指令

jgc previewjgc upload 命令支持通过命令行参数直接传入配置,无需先执行 jgc config 创建配置文件。

小游戏预览-串行指令

完整版本:

jgc preview --appId <appId> --requestToken <requestToken> --entry <entry> --versionName <versionName> --description <description> --game

简写版本:

jgc preview -a <appId> -t <requestToken> -e <entry> -n <versionName> -d <description> --game

小游戏上传-串行指令

完整版本:

jgc upload --appId <appId> --requestToken <requestToken> --entry <entry> --versionName <versionName> --description <description> --game

简写版本:

jgc upload -a <appId> -t <requestToken> -e <entry> -n <versionName> -d <description> --game

参数说明

| 简写 | 完整参数 | 类型 | 必填 | 说明 | |------|---------|------|------|------| | -a | --appId | string | 是 | 小游戏的appId | | -t | --requestToken | string | 是 | 代码上传秘钥 | | -e | --entry | string | 是 | 游戏/插件路径 | | -n | --versionName | string | 否 | 版本号(默认:1.0.0) | | -d | --description | string | 否 | 备注(默认:空字符串) | | - | --game | flag | 否 | 项目类型为游戏(不指定则默认为插件) | | -D | - | flag | 否 | 预发环境 |

使用示例:

# 预览示例
jgc preview -a D1136DDA9C4A1F30EBB03BE412C**** -t e1ad03bba1084a0d9488b33673ec**** -e ./ -n 1.0.0 -d "测试版本" --game

# 上传示例
jgc upload -a D1136DDA9C4A1F30EBB03BE412C**** -t e1ad03bba1084a0d9488b33673ec**** -e ./ -n 1.0.0 -d "正式发布" --game

注意:

  • 如果通过命令行参数传入了 appIdrequestTokenentry 三个必要参数,则优先使用命令行配置,不会读取 jgc.config.js 文件
  • 如果未传入命令行参数,则会自动查找并读取 jgc.config.js 配置文件
  • upload 命令的 versionNamedescription 为必填项

插件-上传功能

小游戏插件的开发也可以通过命令行工具进行快速发布。插件只支持快速上传,无法进行预览。 在生成 jgc.config.js 的同级目录执行以下命令

jgc publish

客户端调试

在非线上小游戏,iOS/Android均支持打开调试模式,支持vConsole查看调试日志。

alt 开启调试

alt 调试

脚本调用

上传功能

const jgcCli = require('jd-minigame-ci')
jgcCli.upload({
  type: 'game', // 类型
  appId: '***', // 小游戏的appId
  requestToken: '', // 小游戏的上传秘钥
  entry: '',  // 需要被打包的小游戏(或者游戏插件)的路径
  versionName: '1.0.0', // 小游戏版本号
  description: 'fix:小游戏bug', // 小游戏版本描述
}).then(data => {
  console.log('data',data);
});

输入参数

| 参数名 | 类型 | 必填 | 说明 | |------------|-------|----|--------------| | appId | string | 是 | 小游戏的appId | | requestToken | string | 是 | 秘钥信息 | | entry | string | 是 | 项目路径 | | versionName | string | 否 | 自定义版本号 | | description | string | 否 | 自定义备注 |

返回值

| 属性 | 类型 | 说明 | |------------|-------|--------------| | url | string | openapp 协议二维码地址 | | expiredTime | string | 过期时间 |

预览功能

const jgcCli = require('jd-minigame-ci')
jgcCli.preview({
  type: 'game', // 类型
  appId: '***', // 小游戏的appId
  requestToken: '', // 小游戏的上传秘钥
  entry: '',  // 需要被打包的小游戏(或者游戏插件)的路径
}).then(data => {
  console.log('data',data);
});

输入参数

| 参数名 | 类型 | 必填 | 说明 | |------------|-------|----|--------------| | appId | string | 是 | 小游戏的appId | | requestToken | string | 是 | 秘钥信息 | | entry | string | 是 | 项目路径 |

返回值

| 属性 | 类型 | 说明 | |------------|-------|--------------| | url | string | openapp 协议二维码地址 | | expiredTime | string | 过期时间 |

更新日志

v1.2.1

  1. F 修复 game.json中unityPlugin固定版本为1.2.58,部分游戏1.2.58会出现报错:Browser.mainLoop.scheduler is not a function;
  2. A 新增 可配置gary灰度环境模式;