Node-Red编辑器和库依赖项

Node-Red Editor and Library dependencies?

本文关键字:依赖 编辑器 Node-Red      更新时间:2023-09-26

我正在创建我的第一个Node-RED贡献。节点将根据编辑器中提供的样例对象清理传入对象。我用的是RED.editorRED.library

我想知道我是否需要在包文件中声明一个依赖项。目前看起来是这样的:

{
    "name"         : "node-red-contrib-objectcleaner",
    "version"      : "0.0.1",
    "description"  : "Removes properties from incoming (payload) object, that are not in a template object",
    "dependencies": { /*Do I need anything here? */
    },
    "keywords": [ "node-red", "validation", "flow" ],
    "node-red"     : {
        "nodes": {
            "objectcleaner": "objectcleaner/objectcleaner.js"
        }
    }
}

如果有的话,依赖关系包含什么?我知道我会把node.js依赖关系,但我需要列出编辑器/库吗?

您可能会在这里的邮件列表中提出这样的问题:

https://groups.google.com/forum/!论坛/node-red

你不需要在依赖项中列出Node-RED,因为这只会把另一个副本拉到node_modules树中。

你应该可以使用在节点初始化时传入的RED对象的引用