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

@subfuzion/run

v0.1.8

Published

Lightweight CLI for serverless projects on Cloud Run. Not an official Google project.

Downloads

249

Readme

run

GitHub version npm version

A lightweight utility for Node.js developers that simplifies creating, deploying, and monitoring serverless Cloud Run apps on Google Cloud.

This is not an official Google project.

run is not a replacement for everything that you can do with the gcloud CLI. In fact, the current version requires that you also install gcloud because it wraps some of gcloud's functionality.

However, run provides a simple and streamlined experience using just a few commands and a configuration file (which it generates).

To create and deploy an application, you run the following commands:

run login
run new
run deploy

You will be prompted for options that will be saved to a configuration file and used for deploying subsequent app revisions.

To contrast this against the equivalent gcloud experience, see this blog post: Getting started with the Google Cloud CLI interactive shell for serverless JavaScript developers

Prerequisites

For gcloud, you only need to install it. You can ignore all other instructions. Once installed, run the following command:

gcloud components install beta

Usage

You can use run from the command line by using npx or by installing it globally with npm.

npx @subfuzion/run

Or

npm i -g @subfuzion/run

If using npx, you might want to create a shell alias:

alias run="npx @subfuzion/run@latest"

Login / logout

run login
run logout

The current version of run wraps auth functionality from gcloud and implements other functionality using the Node.js Cloud Client Library. When you execute run login, you will be prompted for authorization in the browser twice: the first time for running wrapped interactive gcloud CLI commands and the second time for obtaining credentials for use with the client library.

Create a new app

run create

You will be prompted for a name and project template to use.

Deploy an app

run deploy

On first deployment, you will be prompted for a service name to use to identify the deployed app, a globally unique name to identify the Google Cloud project, and a region to deploy the service to.

These settings are saved to a configuration file (run.yaml) in the working directory.

Install run as a package dependency

After setting up your configuration and testing it, you should install run as a package devDependency to your package.json file with the following command:

npm install --save-dev @subfuzion/run

Then you can add package.json run scripts.

  "scripts": {
    "deploy": "run deploy",
  },

run configuration

run uses two configuration files:

  • General user configuration stored in $HOME/.config/run/run.yaml
  • Specific app configuration stored in ./run.yaml

General user configuration

General user configuration consists of a single field:

$HOME/.config/run/run.yaml

# Billing ID (https://console.cloud.google.com/billing)
billingId = '';

Specific app configuration

Specific app configuration consists of the following fields:

./run.yaml

# Google APIs to enable (defaults include APIs to build/deploy Cloud Run app)
googleapis = [
'artifactregistry',
'cloudbuild',
'run',
];

# The Project ID (not necessarily the same as the project name)
project = '';

# Cloud Run region (https://cloud.google.com/run/docs/locations)
region = '';

# The hosted service name to use with Cloud Run
service = '';

Multiple app projects might share the same cloud project ID and region, but the service name must be unique within the cloud project.

The project ID must be globally unique across all of Google Cloud. Read more here.

Contributing changes.

Entirely new samples and bug fixes are welcome, either as pull requests or as GitHub issues.

See CONTRIBUTING.md for details on how to contribute.

Licensing

Code in this repository is licensed under the Apache 2.0. See LICENSE.