
Next, create an index.js file (entry point) in the src folder, import the email function that you’ve created inside the email.js file and add it to the global object. This is a requirement of the Webpack plugin for Google Apps Script.
You can also add a function expression to the global object directly, like doGet in the example below.

Now that your JavaScript code is ready, open the appsscript.json file in your project folder and modify the oAuthScopes property to only include the scopes that are required by your project.
Next, jump to the command line terminal and run the deploy command to push your code to the Apps Script project.
If you are deploying the project for the first time, you’ll get a prompt saying “Manifest file has been updated. Do you want to push and overwrite? (y/N)” – say yes.
After the deployment is complete, open the associated script in the browser with the CLASP open command.
Inside the Apps Script Editor, go to the Run menu and choose the getEmailAddress function from the list. Open the logs and you should see your email addresses in the window.
Then go to the Publish menu, choose Deploy as web app and open the URL in a new browser tab to check the program output. That’s how easy it is to build projects with the Google Apps Script starter kit.
Using Git with Google Apps Script
Create a new repository in Github and make a note of the URL of the new repository. Next, open the terminal and run the following commands to push your Apps Script project to Github.

Also see: Most Useful Google Apps Scripts
The same approach is used by Digital Inspiration for building popular Google add-ons including Gmail Mail Merge, Google Forms Notifications and Document Studio.
Title: Google Apps Script for Developers
Sourced From: https://www.labnol.org/internet/google-apps-script-developers/32305/
Published Date: 2019-04-21 11:36:51


