Git Product home page Git Product logo

apps-script-starter's Introduction

Google Apps Script Development with ES6

Google Apps Script Development ๐Ÿ’ฏ

Google Developers Expert - Google Apps Script, GSuite

Please follow the ๐Ÿ‘‰ step-by-step video tutorial ๐Ÿ‘ˆ for quickly getting started with Apps Script development inside Visual Studio Code.

You can build GSuite add-ons (for Google Docs, Slides, Gmail and Google Sheets), web applications and workflow automation routines with next-generation JavaScript.

Build with Google Apps Script ๐Ÿš€

Setting up a modern development environment for building Google Apps Script projects is easy and quick (video tutorial).

You also need to install Node.js which includes the npm package manager.

Google Apps Script - Setup Development Environment

๐Ÿ“ฆ Getting Started

1. Clone the repository and install npm dependencies

git clone https://github.com/labnol/apps-script-starter my-project
cd my-project
npm install

2. Log in to Google clasp and authorize with your Google account.

npx clasp login

3. Create a new Google Script bound to a Google Sheet (or set the type as standalone to create a standalone script in your Google Drive)

npx clasp create --type sheets --title "My Apps Script Project" --rootDir ./dist

4. Include the necessary OAuth Scopes in the appsscript.json file

5. Deploy the project

npm run deploy

The dist directory contains the bundled code that is pushed to Google Apps Script.

The .claspignore file

The .claspignore file allows you to specify file and directories that you do not wish to not upload to your Google Apps Script project via clasp push.

The default .claspignore file of the Apps Script Starter kit will push all the JS and HTML inside the rootDir folder and ignore all the other files.

๐Ÿ”ฐ Using Git with Google Apps Script

Google Apps Script - Github

Create a new repository in Github and make a note of the URL of the new repository. Next, open the terminal and run the above commands to push your Apps Script project to Github.

๐Ÿ”ฅ Meet the Developer

Amit Agarwal is a web geek, Google Developers Expert (GSuite, Google Apps Script) and author of labnol.org, a popular tech how-to website. He frequently uses Google Apps Script to automate workflows and enhance productivity.

The starter kit is used by Digital Inspiration for building popular Google add-ons including Gmail Mail Merge, Google Forms Notifications and Document Studio.

Reach the author on Twitter or email [email protected]

๐ŸŒŸ Credit/Acknowledgment

Babel

Write code using ES6 features like arrow functions, destructuring, classes, template literals, and the Babel transpiler will transform your ECMAScript 2015/2017 code to ES5 that Apps Script can understand.

Webpack

Webpack is a powerful tool for bundling JavaScript modules. Developers can structure code in directory and Webpack creates a minimized and optimized bundle for pushing to production.

ESLint

A popular linting engine that analyzes your JavaScript code for correctness and highlights the errors in real time before you even compile the code, thus reducing the development time.

Google CLASP

A command line utility for working with Google Apps Script projects. You can develop code locally and push it to production, manage your manifest file, deploy web apps and publish new versions of apps.

Visual Studio Code

This incredibly powerful source code editor from Microsoft provides an integrated development environment and has built-in support for Emmet, Intellisense for code autocompletion, Command Line Terminal, Git integration, Node.js , TypeScript and more.

Prettier

A code formatter that will beautify your JavaScript, JSON, HTML and CSS stylesheets according to a set of rules and styles widely accepted by programmers.

Airbnb

Developers have their own unique style of writing code. Airbnb's JavaScript style guide outlines how JavaScript code should be written and adheres to the rules.

๐ŸŒธ Contribution

Contributions and feature requests are welcome. If you are using the Google Apps Script starter package and fixed a bug for yourself, please consider submitting a PR!

๐Ÿ”’ License

MIT License (c) Amit Agarwal

apps-script-starter's People

Contributors

labnol avatar oshliaer avatar lucaslarson avatar irregularshed avatar dependabot[bot] avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.