How to use require in cloud functions

56 views Asked by At

I'm trying to execute a code node.js in IBM Cloud Functions, but I have an require that isn't pre-installed. Its the const {google} = require('googleapis') How can I install?

1

There are 1 answers

0
James Thomas On

Package the action as a zip file and include a node_modules directory with external dependencies (googleapis) needed.

Official documentation has more details about this approach: https://github.com/apache/incubator-openwhisk/blob/master/docs/actions-node.md#packaging-an-action-as-a-nodejs-module