gasup 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,6 +10,24 @@ A simple CLI tool for bundling Google Apps Script projects with esbuild and the
|
|
|
10
10
|
- **esbuild-gas-plugin integration**: Automatically handles GAS-specific optimizations
|
|
11
11
|
- **File management**: Automatically copies `appsscript.json` and HTML files to the output directory
|
|
12
12
|
|
|
13
|
+
## Making Functions Available in Google Apps Script
|
|
14
|
+
|
|
15
|
+
To make your functions executable in Google Apps Script, you need to expose them globally. Functions that are not exposed globally cannot be called from the GAS interface or triggers.
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
// src/index.ts
|
|
19
|
+
|
|
20
|
+
import dayjs from "dayjs";
|
|
21
|
+
|
|
22
|
+
(global as any).helloWorld = () => {
|
|
23
|
+
console.log('Hello World!');
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
(global as any).today = () => {
|
|
27
|
+
console.log(dayjs().format('YYYY-MM-DD'));
|
|
28
|
+
};
|
|
29
|
+
```
|
|
30
|
+
|
|
13
31
|
## Installation
|
|
14
32
|
|
|
15
33
|
Install gasup as a dev dependency:
|