azure.function中的package引用
dependencies 依存關係
因為需要部署雲端,依存關係無法手動處理(無伺服器特性沒可能去執行npm安裝...)
需於設定檔寫依賴 下面範例引用「streamifier(v0.1.1)」
const streamifier = require('streamifier');
{
"name": "FunctionName",
"version": "1.0.0",
"description": "",
"scripts": {
"start": "func start",
"test": "echo \"No tests yet...\""
},
"author": "Dinoin",
"dependencies": {
"streamifier": "^0.1.1"
},
"devDependencies": {}
}
package.json在function專案資料夾中,理論上是專案中所有function共用。
推測可能於每一次無服務啟動時進行下載,說不定對啟動效能有影響,需要再觀察。
Last updated
Was this helpful?