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 🙏

© 2026 – Pkg Stats / Ryan Hefner

pg-gdrive

v0.1.2

Published

A fork repo from https://github.com/doiska/postgres-gdrive-backup but added the command line and encryption feature

Readme

Postgres Personal GDrive Backup

A fork repo from https://github.com/doiska/postgres-gdrive-backup but added the command line and encryption feature

How to use

Google Cloud Platform Setup

  • Log-in to the Google Cloud Console.
  • Enable Google Drive API.
  • Then create a new service account
  • Click in the three dots on the right of the service account you just created and click on Manage keys.
  • Create a new json key and download the file.
  • Now go to your Google Drive and create a new folder where the backups will be stored.
    • Save the Folder ID, it's the string after https://drive.google.com/drive/folders/{ID HERE}.
  • Share the folder with the service account email (client_email), you can find it on the JSON file you downloaded on the previous step.

Requirements

by default pg-drive use the pm2, pg_dump and pg_restore command to do the backup and restore database, please make sure it already installed on your machine

Installation

npm i -g pg-drive

Run command

after installation finish, you can just run the pg-drive command, and choose the command you want to run,

Note: please run the config command before using the cron and restore to avoid environment error

Configuration Setup

you can set the configuration by using pg-drive config command, but you can also add the configuration manually in ~/.pg_drive/.env, list of configuration:

  • SERVICE_ACCOUNT_PATH: The path to the JSON file of the service account.
    • Example: /path/to/service-account.json (please avoid using the ~/docs/service-account.json somehow nodejs can't recognized it, use the /home/docs/service-account.json)
  • FOLDER_ID: The ID of the folder where the backups will be stored.
    • You can find the ID on the URL of the folder, it's the string after https://drive.google.com/drive/folders/.
    • Example: https://drive.google.com/drive/folders/1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p7q => 1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p7q
  • DATABASE_URL: The connection string of your Postgres database.
  • CRON_EXPRESSION: A schedule for the backups.
    • Example: 0 0 * * * (every day at midnight)
    • You can use crontab.guru to help you create the expression.
  • FILE_PREFIX: A prefix for the backup files.
    • Example: my-database-backup-
    • Result: my-database-backup-2024-02-01.sql.tar.gz
  • RUN_ON_START: If set to true, the backup will run once when the app starts.
  • ENCYRPTION_SECRET: The secret key used for encrypting the backups.