azure.function中的package引用

dependencies 依存關係

因為需要部署雲端,依存關係無法手動處理(無伺服器特性沒可能去執行npm安裝...)

需於設定檔寫依賴 下面範例引用「streamifier(v0.1.1)」

index.js
const streamifier = require('streamifier');
package.json
{
  "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?