This guide will discuss script development for use with @helixml/apps-client
. The following script types are supported and will be covered:
- Google Apps Script: A serverless JavaScript runtime for G Suite automation, extension, and integration. It allows for creating web apps, add-ons, and integrations with other services. (Source: Google Apps Script – Sweetcode.io)
Stand-alone Script: A script that is not associated with any specific G Suite application. (Source: Stand-alone Script)
Node.js: An open-source JavaScript runtime environment for building modern scalable applications, including microservices, single page applications, scripting and automation, agents and data collectors, desktop applications, and embedded software. (Source: Node.js: Develop javascript applications that run outside of a browser)
JavaScript: A versatile language for adding interactivity to web pages and building command-line apps. (Source: Java vs JavaScript)
Examples for each script type:
Google Apps Script (Stand-alone Script):
function doGet() {
return ContentService.createTextOutput('Hello, World!');
}
Node.js:
import axios from 'axios';
const fetchData = async () => {
try {
const response = await axios.get('https://api.example.com/data');
console.log(response.data);
} catch (error) {
console.error(error);
}
};
fetchData();
JavaScript:
const greet = (name: string) => {
console.log(`Hello, ${name}!`);
};
greet('World');
For more information on these script types, refer to the provided sources.