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

@openformation/gpm

v1.1.0

Published

CLI for managing multiple Google Cloud Platform projects.

Readme

Google Cloud Project Manager

✨ Features

  • Allows fast switching between GCP projects.
  • Takes care of your Application Default Credentials (ADC) so that you don't have to gather them after switching a project.
  • Support for defining your GCP project directly in your repository.

🏃🏽‍♀️ Motivation

When you're deploying projects to the Google Cloud Platform, chances are high that you have gcloud configured locally. Although, gcloud allows the configuration of multiple projects and accounts, it doesn't support multiple Application Default Credentials (ADC) out of the box. ADCs are useful if you develop on your local machine, but communicate with GCP services directly in the cloud. For example, all official Google Cloud libraries for Node.js are using ADCs so that no further service account configuration is necessary.

gpm faces this problem by adding your local configured gcloud project to an own repository, including your configured ADCs. With this in place, it is possible to switch between projects quite easily without executing gcloud auth application-default login over and over again.

📦 Installation

npm i -g @openformation/gpm

Alternatively, when you're using npm in your projects, you could install gpm as a devDependency and execute it in your npm run scripts accordingly:

npm i -D @openformation/gpm

🔧 Usage

Adding existing projects

Due to the fact that you will have a configured Google Cloud project in place, we add this to the gpm repository right now:

gpm register

Adds your currently configured project to the repository. Performing a gpm info will show you that this was successful.

Adding new projects

When you are using gpm and want to add another gcloud project, you have to deactivate the project you're currently using with gpm, perform the gcloud initialization and register the project in the gpm repository afterwards:

gpm deactivate

gcloud init

gpm register

Activating a project

Via the CLI

When you want to switch between projects, you have to options: 1.) Selecting it through the gpm CLI or 2.) Using a local .gpmrc which – for example – lives in your source repository. Let's checkout both ways:

gpm activate

This command gives you a list of all gcloud projects that live in the gpm repository. You can select the one you want to use from this list.

Via a configuration file

As described above, the second apporach is via a configuration file (.gpmrc). This file includes the name of the project:

my-fancy-gcloud-project-v1

When executing a gpm use in the directory where this file lives, gpm will determine if the user has this project in her local repository and activates that accordingly.

Automatic activation

We can go even deeper and create a small "bash" function which recognizes if you cd into a directory in which a .gpmrc lives. Whenever this function recognizes the file, it invokes gpm use so that the correct project gets activated.

To make this happen, add this function to your ~/.bashrc or ~/.zshr (depends on which shell you're using):

function cdgpm() {
  cd "$@";

  if [ -f $(pwd)/.gpmrc ]; then
    gpm use
  fi
}

alias cd='cdgpm'
cd $PWD

🎨 Contributing

You don't need to have any fancy prerequisites, just the current LTS release of Node.js

git clone [email protected]:openformation/gpm.git

cd gpm

# Install the correct Node.js version, using `fnm`
fnm use

# Install the dependencies
npm i

Now you are all set up for hacking on the code. Testing a CLI command, is possible via ts-node, for example ...

npx ts-node src/index.ts --version

... will print the version of gpm.

Commitizen

Commitizen friendly

The project is using commitizen for ensuring semantic commit messages. So whenever you perform a git commit an assistant will guide you through the steps of writing semantically correct commit messages.

👩🏽‍⚖️ Copyright

Copyright (C), 2021 Open Formation GmbH – Hamburg – Germany All Rights Reserved

Unauthorized copying of the files within this repository, via any medium is strictly prohibited proprietary and confidential.