https://github.com/fossamagna/gasify
Browserify plugin for Google Apps Script
https://github.com/fossamagna/gasify
browserify google-apps-script
Last synced: about 1 month ago
JSON representation
Browserify plugin for Google Apps Script
- Host: GitHub
- URL: https://github.com/fossamagna/gasify
- Owner: fossamagna
- Created: 2015-12-08T13:17:05.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2023-10-11T20:15:24.000Z (over 1 year ago)
- Last Synced: 2025-03-09T10:32:30.818Z (about 1 month ago)
- Topics: browserify, google-apps-script
- Language: JavaScript
- Homepage:
- Size: 1.01 MB
- Stars: 40
- Watchers: 2
- Forks: 6
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# gasify [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url] [![Coverage percentage][coveralls-image]][coveralls-url] [](https://greenkeeper.io/)
[Browserify](http://browserify.org/) plugin for Google Apps Script.
## About
In Google Apps Script, it must be top level function declaration that entry point called from [google.script.run](https://developers.google.com/apps-script/guides/html/reference/run).
When `gasify` detect a function assignment expression to `global` object. it generate a top level function declaration statement.## example
main.js:
```js
var echo = require('./echo');
global.echo = echo;
```echo.js:
```
module.exports = function(message) {
return message;
}
```build:
```
$ browserify main.js -p gasify -o Code.gs
```Code.gs
```js
var global = this;function echo() {
}(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o