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

@yuliqi/node-red-contrib-qjwt

v0.0.7

Published

This node allows you to sign and validate JSON Web Token (JWT)

Readme

node-red-contrib-qjwt

Node-RED 节点:用于 签发与验证 JSON Web Token (JWT)
支持多种签名算法(HS256 / RS256)、多种 Token 来源(payload、Bearer Header、Query 参数等),
并支持 claims 校验、过期时间、nbf、生效时间、maxAge 等高级验证机制。


🚀 安装方式

方法一:通过 Node-RED Palette Manager 安装

  1. 打开 Node-RED 编辑器右上角菜单
  2. 点击 “管理调色板(Manage Palette)”
  3. 切换到 “安装(Install)” 选项卡
  4. 搜索 node-red-contrib-qjwt
  5. 点击安装即可

方法二:使用 npm 安装

npm install @yuliqi/node-red-contrib-qjwt

安装完成后,节点会自动出现在 Node-RED 编辑器中,类别为 “qjwt”


🧩 节点说明

节点:qjwt-sign —— 签发 JWT

此节点用于 签发 JSON Web Token。 支持对称密钥(Secret)或非对称密钥(Private Key)签名。

🔸 输入

| 属性 | 类型 | 描述 | | ------------- | --------------- | ---------------------- | | msg.payload | object / string | 要签发的 Token 内容(payload) |

🔹 输出

| 输出端口 | 内容 | | ------------- | ------------ | | msg.payload | 签发后的 JWT 字符串 | | (可选)错误输出 | 签发失败信息 |

⚙️ 主要配置项

  • Mode:签发模式(Secret / Private Key)
  • Algorithm:算法,如 HS256RS256
  • Secret / Private Key:密钥来源,可来自环境变量、输入消息或固定字符串
  • Expires In:有效期(秒)
  • Audience / Issuer:受众与签发者
  • Not Before (nbf):生效时间(秒)

节点:qjwt-verify —— 验证 JWT

此节点用于 验证 JSON Web Token 的真实性与有效性

🔸 输入

| 属性 | 类型 | 描述 | | ------------- | ------ | ------------------------------- | | msg.payload | string | Token 字符串,或从 Header / Query 中提取 |

🔹 输出

| 输出端口 | 内容 | | ------------- | ----------------------- | | msg.payload | 验证成功后的 Token payload 对象 | | (可选)错误输出 | 验证失败信息 |

⚙️ 主要配置项

  • Mode:验证模式(Secret / Public Key / JWK)
  • Token 来源:payload、Bearer Header、Query 参数等
  • Algorithms:允许算法(可选)
  • Ignore Expiration / NotBefore:是否忽略过期或未生效检查
  • Audience / Issuer:校验受众与签发者
  • Max Age:限制 Token 最大存活时长(秒)
  • Validate Claims (约束):自定义 payload 校验规则

🧠 高级功能:Claims 验证(Constraints)

支持多种基于 JSON Schema 的校验规则,可验证:

  • 必填字段(required
  • 字符串格式(patternemailuuidurl 等)
  • 数值范围(maximum_numberminimum_number
  • 数组内容(any_ofinclusionexclusion
  • 复杂嵌套属性(支持 extra.second 形式的路径)

🧪 示例导入

可直接在 Node-RED 编辑器中导入示例流程使用:

菜单 → 导入 → 示例 → 选择 “JWT 示例”

导入后即可查看完整演示,包括签发、验证、过期、nbf、生效时间、maxAge 与 claims 校验等功能。


📚 参考资料