2015-07-12 35 views
0

我正在創建我的第一個Node-RED contribution。節點將根據編輯器中提供的示例對象來清理傳入對象。我正在使用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依賴關係放在那裏,但是我需要列出編輯器/庫嗎?

回答

1

你可能會做的更好,詢問郵件列表在這裏這樣的問題:

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

你不應該需要列出節點RED的依賴,因爲這會拉在另一個副本到node_modules樹中。

你應該只使用引用是當節點被初始化

+0

THX傳入RED對象被罰款。是這樣:https://groups.google.com/forum/#!topic/node-red/BV5Mil_SU0k – stwissel