AppsScriptPulse

Logger Drop-in Replacement for V8 Runtime

Why not make it a proper library? Because to make it a drop-in replacement, needs to have access to global scope, which a library doesn’t.

The V8 runtime changes how the Logger class works, which has shown much slower load times for simple Logging statements. This snippet writes all Logger.log calls to a spreadsheet when invoked, greatly speeding up development time.

Source: classroomtechtools/modularLibrariesV8

Google Apps Script Library Database

Photo by Markus Spiske on Unsplash

Photo by Markus Spiske on Unsplash

Andrew Roberts (@andrewroberts6) is creating a massive database which records information about Apps Script libraries that are publicly available. He includes the name, a short description, project key, and other helpful information (links, last updated, etc) for finding helpful libraries.

Source: Google Apps Script Library Database – Google Sheets

Unit Testing in GAS Part 5: Testing Objects and Arrays

It’s time to dive into deeper equality situations with objects and arrays. Every test we’ve written so far has used a non-strict comparison. In other words, we’ve only been checking value but not type. This is particularly important in JavaScript because of how it handles truthy and falsy values.

The fifth part of a series using the GAS QUnit library to write unit tests for Apps Script projects in the web editor. This post details testing arrays and objects.

Source: Unit Testing in GAS Part 5: Testing Objects and Arrays

Google Apps Script Development – Best Practices – Andrew Roberts

This is an overview of the various techniques and best practices I have evolved in developing Google Apps Scripts over the years. Of course Google have got a few suggestions of their own, and there are plenty of more general …

This includes some good design pattern considerations for Apps Script projects as well as links to testing libraries, boilerplate frameworks, and extensions that help manage Apps Script work.

Source: Google Apps Script Development – Best Practices – Andrew Roberts

SpreadAPI: add REST API to any spreadsheet in Google Sheets

SpreadAPI

Image: spreadapi.com

SpreadAPI is a free Google Apps Script that allows you to add REST API to any spreadsheet in Google Sheets in a few minutes. The API can be accessed over HTTPS from back-end as well as front-end apps.

It’s currently possible to publish a Google Sheet as JSON to get the data in a third-party application, but it’s harder to allow for posting new data back to that sheet. SpreadAPI is a script that creates a full-function REST API for a Google Sheet. Each implementation is set up individually and provides multiple authentication methods for specific users or even anonymous users.

Source: spreadapi.com

Unit Testing in GAS Part 4: Error Handling | ohhey[blog]

Up until now, our Calcs class has handled errors with simple true and false flags. That’s not helpful to the user. At this point, we’re ready to begin defining and testing custom errors in our functions.

QUnit allows a throws method which can check for errors in your application. This tutorial post adds some error checking to a simple Apps Script project.

Source: Unit Testing in GAS Part 4: Error Handling | ohhey[blog]

Unit Testing GAS Part 3: Adding and Testing Functions | ohhey[blog]

We’ve looked at how to install and configure QUnit and just finished writing some simple tests. In this post, we’re going to write a new method, add(a, b) in Calcs which will add the two passed parameters.

Part 3 in the unit testing series, this post looks at writing tests for new methods and some considerations for when (or when not) to use private functions in Javascript when it comes to testing.

Source: Unit Testing GAS Part 3: Adding and Testing Functions | ohhey[blog]

Unit Testing GAS Part 2: Simple Tests | ohhey[blog]

Unit tests are for single units of code. They test a specific function for a specific result…

Part two in a series on unit testing, this configures the QUnit web application and has you write simple tests against an Apps Script class.

Source: Unit Testing GAS Part 2: Simple Tests | ohhey[blog]

Unit Testing GAS Part 1: QUnit Setup | ohhey[blog]

I’m not good at writing testable code. I’m more of a ‘figure it out when it breaks’ kind of hobby programmer. The problem with this is that I am constantly making my own bugs and not really finding them until a bad time.Unit testing is the process of running automated tests against your code…

The first post in a series, this will eventually be an in-depth look at unit testing both as a habit of writing code and through the lens of large Apps Script projects.

Source: Unit Testing GAS Part 1: QUnit Setup | ohhey[blog]

Working with Google Apps Script in Visual Studio Code using clasp – Yagisanatode

This little tutorial is going to guide us through the steps that will allow us to work, push and pull Google Apps Script code from the online editor to Visual Studio Code.

Related to the clasp CLI from Google, this short guide gets you set up with clasp, installing an auto-completion library, and pushing a project from VS Code to your Apps Script project online.

Source: Working with Google Apps Script in Visual Studio Code using clasp – Yagisanatode

Write Apps Script Offline with clasp

🗺️ Develop Locally: clasp allows you to develop your Apps Script projects locally. That means you can check-in your code into source control, collaborate with other developers, and use your favorite tools to develop Apps Script.

Source: google/clasp

The Apps Script IDE is great, but with larger projects, I know I’ve wanted to be able to use a more powerful IDE. clasp (Command Line Apps Script Projects) is a CLI that allows you to start, write, test, and deploy Apps Script projects from any text editor you want.

Subscribe to Apps Script Pulse...