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 🙏

© 2024 – Pkg Stats / Ryan Hefner

google-apps-script

v4.1.13

Published

gas, the complete CLI for Google Apps Script

Downloads

484

Readme

gas, the Google Apps Script command-line tool

npm GitHub stars NPM Downloads Circle CI Known Vulnerabilities David Codacy Badge

Installation

$ npm i -g google-apps-script

Getting started

Enable the Apps Script API for your account

  • Visit https://script.google.com/home/usersettings and enable the Apps Script API

Authenticate the Drive API

  • Add -f to force reauthentication
  • Add -s to show the authentication url instead of opening a webbrowser
$ gas auth [-f][-s]

Local development

  • Standalone scripts can be referenced by name, container bound script projects must be referenced by projectId.
  • You can find a projectId from the url of a details page in My Scripts

Setup a new script project or clone an existing one

$ gas new <projectName>
$ gas clone <projectName|projectId>

List your remote standalone script projects and their ids

  • There is an optional filter on projectName
$ gas get projects [filter]

Pull and push code from/to your remote script project

  • Gas also supports shared scripts, Team Drives and container bound scripts
  • Files in subfolders are mapped to their relative pathname in a project and the other way around
  • You can specify to pull or push a single file by adding a filename to the command
  • Delete a single remote file by adding -d to the push command
$ gas pull [fileName]
$ gas push [fileName] [-d]

Rename a remote script

$ gas rename <projectName|projectId> <newProjectName>

Linking a script to the current working directory

  • See the last example for some context
$ gas link <projectName|projectId>

Open the linked or a specified project in the online editor

$ gas open [projectName|projectId]

Show some info about the linked or a specified project

$ gas show [projectName|projectId]

Check for differences between your local and remote project files

$ gas status

Including libraries

$ gas include
$ gas include -s packageName

Managing projects, versions and deployments

Create, delete or get a remote project

  • Create will always happen in the root of My Drive (for now)
$ gas create project <projectName>
$ gas delete project <projectName|projectId>
$ gas get projects [filter]

Create or get a version

$ gas create version [-d description] [-p projectName|projectId]
$ gas get versions [projectName|projectId]

Create or get a deployment

$ gas create deployment [-d description] [-v versionNumber] [-p projectName|projectId]
$ gas get deployments [projectName|projectId]

Config (optional)

Configure gas to use .gs as local extension or to use a custom Google OAuth2 client to do the API requests

$ gas config [-e][-i][-r] [configFile.json]

Examples

$ gas new myProject
$ cd myProject
$ gas open
$ gas get projects
$ gas clone myProject
$ cd myProject
$ gas create myProject2
$ mkdir src
$ cd src
$ gas link myProject2
$ gas show
$ gas pull

.gitignore and .gasignore

Gas creates some extra files in a .gas folder. None should be checked into git, so a .gitignore file gets added to your project if there isn't one present yet.

.gasignore has exacly the same purpose and functionality as .gitignore but for the Google Apps Script remote and gets created by default to ignore the node_modules folder.

$ cat .gasignore

Suggestions or questions? Tweet me @MaartenDesnouck or create an issue on github.