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

n8n-nodes-mop-twin

v0.5.6

Published

MOP manufacturing line digital twin helpers: takt beat (JPH × speed), station timing, traffic gate, branch routing, visualization ping for n8n

Readme

n8n-nodes-mop-twin

面向 MOP 产线数字孪生 / 节拍仿真 的 n8n 自定义社区节点包(v0.3.8):节拍放行、工位墙钟、操作工位(带 stationId)、工位缓冲区(占用分流或 工作流 FIFO 池)、信号灯(绿/黄/红三路)、多路分支、可视化上报;与内置 MySQLWaitHTTP Request(PLC) 组合使用。

n8n-nodes-des-twin 更名而来:npm 包名、节点 name、输出 JSON 字段前缀均已改为 MOPmopStationmopTraffic 等)。旧工作流中的 des* 节点需手动替换。


一、节点一览

| 节点 | name | 说明 | |------|--------|------| | MOP 节拍放行 | mopTaktBeat(v1/v2,默认 v2) | 整批流水线循环(每次执行 1 辆车 + 静态队列回本节点,无需 Split In Batches);见下文 | | MOP 工位墙钟 | mopStationTiming | mopStation.waitWallSeconds(Wait:$json.mopStation.waitWallSeconds) | | 操作工位 | mopWorkstation | mopWorkstationstationIdwaitWallSeconds 等);可与墙钟二选一或串联 | | 工位缓冲区 | mopBuffer(v1/v2) | 双输出:可入区 / 已满。v2:按占用数字段工作流 FIFO 池(入队/出队,跨执行,见下文) | | MOP 信号灯 | mopTrafficLight | 三个主输出:绿灯 / 黄灯 / 红灯;每条带 mopTraffic(含 branchbranchNamereason) | | MOP 多路分支 | mopBranchRoute(v2) | 单输出;mopBranch.lane;多行匹配 + 下游 Switch | | MOP 可视化上报 | mopVisualizationPing | mopVisual,默认 eventName: mopBatch |


二、构建

cd n8n-nodes-mop-twin
npm install
npm run build

仓库根:npm run n8n-nodes:build


三、安装到 n8n

  • Community nodes:安装 n8n-nodes-mop-twin(或 @版本)。
  • 命令行cd ~/.n8n/nodes && npm i n8n-nodes-mop-twin,重启 n8n。
  • 画布搜索:「MOP」「工厂」(各节点 codex.alias 已带工厂/MOP 产线词,便于在 Search nodes 里一次搜出一组)、「操作工位」「工位缓冲区」

四、推荐拓扑

MOP 节拍放行:整批 vs 流水线(一辆接一辆)

整批 item(默认「整批 item」):一次执行产出 N 条 item,每行 JSON 仍是一辆车;下游在同一次 execute 里收到整份 items 数组,不会在墙钟上自动间隔切勿把本节点输出经 Code 等再接回本节点入口(会形成执行环、连线显示上千条 item)。若仍用这种模型又要墙钟间隔,可在下游用 Wait$json.spawnIntervalSimMs)等自行控节奏,或 Split In Batches(批量 1)类方案。

流水线循环(节点里选「流水线循环」):每次节点执行 只输出 1 辆车,剩余车保存在 工作流静态数据 队列中。拓扑为 [MOP 节拍放行] → …处理… → [Wait 可选] → 回到 [MOP 节拍放行];仅当上一辆车 JSON 里 mopTwinTaktPipelineContinuation === true 时应继续回路,队列为空后不要再回本节点(否则会报错)。可选打开 「续发前在本节点内等待」spawnIntervalSimMs 做节拍的 sleep(若下游再接 Wait,注意避免双重间隔)。不需要 Split In Batches。

[触发] → [MOP 节拍放行] → [MySQL] → [MOP 信号灯]
            ├ 绿灯 → …
            ├ 黄灯 → …
            └ 红灯 → …
     → [MOP 多路分支] → [Switch:按 $json.mopBranch.lane]
     → [工位缓冲区](可入区)→ …
     → [操作工位] 或 [MOP 工位墙钟] → [Wait] → [HTTP PLC] → [MOP 可视化上报]

工位缓冲区:n8n 里能做「池子、先进先出」吗?

可以部分实现。同一次执行里,数据本来就是按 item 顺序往下传的,不需要额外池子。跨多次执行(例如定时器多次进站、另一次执行再出站)要在 n8n 里记住队列,必须用持久化载体。本包 v2 在 「工作流 FIFO 池(跨执行)」 模式下使用 n8n 的 getWorkflowStaticData('global'):入队节点把每条 item 的 json 序列化进工作流级队列,出队节点在之后的执行里按 FIFO 取出并交给下游。

注意:仅存可 JSON.stringify 的字段不含 binary;并行触发多次执行时不能保证原子性(适合孪生/演示,硬生产建议 Redis 或数据库队列)。

典型接法:一条分支 入队(动作选「入队」)接在上游之后;另一条分支用 Schedule 等触发 出队(同一 bufferId、动作选「出队」),「可入区」输出即池头弹出的 payload。


五、发布 npm

见包内 scripts/pre-publish-check.mjsnpm run publish:npm(需 npm login)。


六、许可

MIT。