0

我正在创建我的第一个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 依赖项放在那里,但是我需要列出编辑器/库吗?

4

1 回答 1

1

你可能会更好地在邮件列表中提出这样的问题:

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

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

只需使用初始化节点时传入的对RED对象的引用就可以了

于 2015-07-12T13:51:01.603 回答