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 🙏

© 2021 – Pkg Stats / Ryan Hefner

@invisible/deploy

v1.0.13

Published

Module to help deploy and run Google App Engine projects.

Downloads

43

Readme

deploy

CircleCI

Module to help deploy and run Google App Engine projects with features like:

  • Deploy multiple services for production and staging.
  • Sync static files from your PC to Google Storage and to App instances.

Install

npm install @invisible/deploy

# or

yarn add @invisible/deploy

Make sure to install as a normal dependency, since part of it is run on the deployed instance, and dev-dependencies are not installed on production.

Prerequisites

  1. Create a project https://console.cloud.google.com and note the project ID.
  2. Install the gcloud sdk https://cloud.google.com/sdk/downloads
  3. If this is your first time using the gcloud sdk make sure to run gcloud auth login
  4. From your project directory, run gcloud app create --project=your-project-id --region=us-central

Setting up

  1. Create an .env file in your project's root folder. Add your GCLOUD_PROJECT environment variable to it. Don't set PORT in your staging/.env or production/.env, GAE will set this for you.
GCLOUD_PROJECT=gae-project-id-1a6std

This will be used to sync your local storage files to the bucket.

  1. Run ./node_modules/.bin/deploy setup to create the backend bucket on Google Cloud.

  2. Create a folder named storage on your project's root folder. Inside this folder you should have one folder for each services you want to deploy. In each folder you should store the files you want to sync in your instances.

// Storing environment files for production and staging:
storage
├── production
│   └── .env
└── staging
    └── .env
  1. Add storage to your .gitignore file.

  2. Create an GAE yaml config file for each environment you want to have.

# production.yaml
service: default
runtime: nodejs
env: flex

skip_files:
 - ^node_modules$
 - ^ignore$
 - ^.env$
# staging.yaml
service: staging
runtime: nodejs
env: flex

skip_files:
 - ^node_modules$
 - ^ignore$
 - ^.env$

manual_scaling:
  instances: 1
  1. Add sync to your prestart hook on package.json:
// package.json
"scripts": {
  "prestart": "./node_modules/.bin/sync",
  ...
}
  1. Make sure you already have a default service running before you deploy any other. You can deploy to production with ./node_modules/.bin/deploy production.

  2. If you are experience a bug, it might be a problem with the --quiet flag, so try running the command gcloud app deploy production.yaml --project=your-project-id --promote

Commands

deploy

Usage:

deploy [setup|download|static|production|staging|branchName]

Argument can be:

  • setup Creates the default backend bucket for this project.

  • download Downloads all static files from the backend bucket.

  • static Uploads all static files to the backend bucket.

  • branchName Uploads branch static files and deploys the App to Google App Engine based on branchName.yaml file.

sync

Usage: Add ./node_modules/.bin/sync as the value of scripts.prestart on your package.json.

Retrieve files from your project's backend bucket and place it on current instance's root folder.