Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
@google/clasp
Advanced tools
Develop Apps Script projects locally using clasp (Command Line Apps Script Projects).
To get started, try out the codelab!
First download clasp
:
npm i @google/clasp -g
Then enable Apps Script API: https://script.google.com/home/usersettings
🗺️ Develop Locally: clasp
allows you to develop your Apps Script projects locally. That means you can check-in your code into source control, collaborate with other developers, and use your favorite tools to develop Apps Script.
🔢 Manage Deployment Versions: Create, update, and view your multiple deployments of your project.
📁 Structure Code: clasp
automatically converts your flat project on script.google.com into folders. For example:
tests/slides.js
tests/sheets.js
tests/
slides.js
sheets.js
clasp
clasp login [--no-localhost]
clasp logout
clasp create [scriptTitle] [scriptParentId]
clasp clone <scriptId>
clasp pull
clasp push
clasp open
clasp deployments
clasp deploy [version] [description]
clasp redeploy <deploymentId> <version> <description>
clasp version [description]
clasp versions
clasp login
clasp logout
Run clasp login --no-localhost
to manually enter a code instead of running a local server.
Files in the current directory are added to the project. Optinally provide a script title or parent G Suite doc ID.
clasp create [scriptTitle] [scriptParentId]
clasp clone <scriptId>
clasp push # Updates Apps Script project with local files
clasp pull # Updates local files with Apps Script project
To deploy a project:
clasp version
clasp deploy [version]
clasp versions # List versions
clasp version [description] # Create a new version with a description
then deploy...
clasp deploy [version] [description]
clasp undeploy <deploymentId>
clasp deployments # List all deployment IDs
clasp open
Create a file called .claspignore
in the root directory of your Apps Script project. Add patterns as if it were a .gitignore, and they will be excluded from clasp push
.
A sample .claspignore
could look like:
**/**
!build/Main.js
!appsscript.json
This file ignores everything but the manifest and the bundle.
Note: the .claspignore
file is parsed with Anymatch, making it match files differently from a typical .gitignore
, especially with directories. To ignore a directory, use syntax like **/node_modules/**
The library requires Node version >= 4.7.4.
node -v # Check Node version
sudo npm install n -g
sudo n latest
The Apps Script CLI uses TypeScript to provide autocompletion and linting when developing. Use an IDE like Visual Studio Code for TypeScript autocompletion.
Install tsc
: npm install -g typescript
npm run build;
clasp <command>
test.sh
, try cases that the PR may affect.npm run lint
.index.js
locally. .gitignore
/.npmignore
will hide js/ts files appropriately.npm publish --access public
⚡ Powered by the Apps Script API.
FAQs
Develop Apps Script Projects locally
The npm package @google/clasp receives a total of 16,706 weekly downloads. As such, @google/clasp popularity was classified as popular.
We found that @google/clasp demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.