
Local development
While building and testing functions directly in the Cloud Console is doable, doing so leads to slow development iterations. It is often more desirable to develop and test functions locally. Google provides a Cloud Functions emulator to facilitate local development, which can be installed as a traditional npm package. To install the Cloud Functions emulator, simply run:
npm install -g @google-cloud/functions-emulator
At the time of writing, the Cloud Functions emulator is made available as an alpha release. Installing and running the emulator requires Node.js 6.11.5+ be installed on the development machine. Once installed, the functions command will be available. The emulator can be controlled via functions start, functions stop, and functions kill. Once running, any command that can be used on the gcloud beta functions command group will work on the functions command. The functions command is a full implementation of the Google Cloud Functions API.