npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

gasup

v1.0.5

Published

A simple CLI tool for bundling Google Apps Script projects with esbuild and the esbuild-gas-plugin.

Readme

Gasup

A simple CLI tool for bundling Google Apps Script projects with esbuild and the esbuild-gas-plugin.

Features

  • Simple bundling: Bundle your TypeScript/JavaScript code into a single file optimized for Google Apps Script
  • Watch mode: Automatically rebuild when files change during development
  • Easy configuration: Interactive wizard to create configuration files
  • esbuild-gas-plugin integration: Automatically handles GAS-specific optimizations
  • File management: Automatically copies appsscript.json and HTML files to the output directory

Making Functions Available in Google Apps Script

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.

// src/index.ts

import dayjs from "dayjs";

(global as any).helloWorld = () => {
  console.log('Hello World!');
};

(global as any).today = () => {
  console.log(dayjs().format('YYYY-MM-DD'));
};

Installation

Install gasup as a dev dependency:

npm install -D gasup

Quick Start

  1. Initialize your project (creates gasup.config.ts):

    npx gasup init
  2. Bundle your project:

    npx gasup
  3. Push to Google Apps Script:

    clasp push

Commands

gasup

Bundles your Google Apps Script project using the current configuration.

# Using npx
npx gasup

# Using pnpm
pnpm gasup

# Using yarn
yarn gasup

gasup --watch

Watches for file changes and automatically rebuilds your project.

# Using npx
npx gasup --watch

# Using pnpm
pnpm gasup --watch

# Using yarn
yarn gasup --watch

gasup init

Interactive wizard to create a gasup.config.ts configuration file.

# Using npx
npx gasup init

# Using pnpm
pnpm gasup init

# Using yarn
yarn gasup init

The wizard will ask for:

  • Entry point (default: src/index.ts)
  • Output file (default: dist/bundle.js)
  • appsscript.json path (default: appsscript.json)

gasup config

Displays the current configuration.

# Using npx
npx gasup config

# Using pnpm
pnpm gasup config

# Using yarn
yarn gasup config

Using npm scripts (Recommended)

Add these scripts to your package.json for easier access:

{
  "scripts": {
    "build": "gasup",
    "dev": "gasup --watch",
    "init": "gasup init",
    "config": "gasup config"
  }
}

Then you can run:

npm run init    # Initialize configuration
npm run build   # Bundle your project
npm run dev     # Watch mode for development
npm run config  # Show configuration

Configuration

Create a gasup.config.ts file in your project root:

import { Config } from 'gasup';

const config: Config = {
  entryPoint: 'src/index.ts',
  outputFile: 'dist/bundle.js',
  appsScriptJsonPath: 'appsscript.json',
};

export default config;

Configuration Options

| Option | Type | Default | Description | |--------|------|---------|-------------| | entryPoint | string | 'src/index.ts' | Path to your main TypeScript/JavaScript file | | outputFile | string | 'dist/bundle.js' | Path for the bundled output file | | appsScriptJsonPath | string | 'appsscript.json' | Path to your appsscript.json file |

Project Structure

your-project/
├── src/
│   └── index.ts          # Your main entry point
├── dist/
│   ├── bundle.js         # Bundled output (auto-generated)
│   └── appsscript.json   # Copied from root (auto-generated)
├── appsscript.json       # Google Apps Script configuration
├── gasup.config.ts       # Gasup configuration (optional)
└── package.json

How it works

  1. Bundling: Uses esbuild with the esbuild-gas-plugin to bundle your code
  2. Optimization: Automatically applies Google Apps Script-specific optimizations
  3. File copying: Copies appsscript.json and any HTML files to the output directory
  4. Watch mode: Monitors file changes and automatically rebuilds when needed
  5. Ready for deployment: The bundled file is ready to be pushed to Google Apps Script

Examples

Basic usage

# Initialize configuration
npx gasup init

# Bundle your project
npx gasup

# Push to Google Apps Script
clasp push

Development with watch mode

# Start watch mode for development
npx gasup --watch

# In another terminal, push changes
clasp push

Using npm scripts

# Add to package.json scripts
npm run init
npm run dev      # Watch mode
npm run build    # One-time build
clasp push

Custom configuration

// gasup.config.ts
import { Config } from 'gasup';

const config: Config = {
  entryPoint: 'src/main.ts',
  outputFile: 'build/script.js',
  appsScriptJsonPath: 'gas/appsscript.json',
};

export default config;

Requirements

  • Node.js 18+
  • Google Apps Script project set up with clasp
  • TypeScript or JavaScript source files

License

MIT