In Mini Program cloud functions, we can import third-party dependencies to accelerate development. Since the runtime environment for cloud functions is Node.js, we can use npm to install third-party dependencies. For instance, in addition to using the native http interface provided by Node.js to initiate network requests within cloud functions, we can also use a popular Node.js network request library request to make network requests more conveniently.
Note that when selecting to upload a cloud function in the IDE, you can choose to install dependencies in the cloud (do not upload the node_modules folder) or perform a full upload (upload the node_modules folder simultaneously).
In the next section, we will explore the cloud function SDK provided by the platform: wx-server-sdk.