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

@hazeloffc/google-drive

v1.0.1

Published

Use Google Drive as a simple database by zipping files and uploading them.

Readme

Google Drive Node.js Library

This Node.js library provides a robust and efficient solution for managing and uploading files to Google Drive. It is specifically designed to simplify the process of backing up and organizing data, allowing developers to upload files of any supported format with ease. During the upload process, all files are automatically converted into a ZIP archive, ensuring a compact and well-structured backup. The library emphasizes reliability, performance, and ease of integration, making it an ideal choice for both individual developers and enterprise-level applications that require seamless cloud storage management.


Features

Convert all files like JSON, JS, SQL, and more into a ZIP, then upload them to your Google Drive. We highly recommend subscribing to Google Drive for increased storage.


Example Code

const { uploadDatabase } = require("@hazeloffc/google-drive");
const credentials = require("./credentials.json");

(async () => {
  try {
    const result = await uploadDatabase({
      source: "./",                
      output: "./backup.zip",     
      credentials,                   
      folderId: "YOUR_DRIVE_FOLDER_ID"
    });

    console.log("🚀 Done! File uploaded:");
    console.log("🔗 Drive Link:", result.webViewLink);
  } catch (err) {
    console.error("❌ Failed:", err);
  }
})();

Example Code: Monthly Upload

const { uploadDatabase } = require("@hazeloffc/google-drive");
const credentials = require("./credentials.json");

function getMonthlyBackupName() {
  const now = new Date();
  const year = now.getFullYear();
  const month = String(now.getMonth() + 1).padStart(2, "0");
  return `backup-${year}-${month}.zip`;
}

(async () => {
  try {
    const output = `./${getMonthlyBackupName()}`;
    const result = await uploadDatabase({
      source: "./",                
      output,                     
      credentials,                 
      folderId: "YOUR_DRIVE_FOLDER_ID" 
    });

    console.log("🚀 Done! File uploaded:");
    console.log("📦 Local File:", output);
    console.log("🔗 Drive Link:", result.webViewLink);
  } catch (err) {
    console.error("❌ Failed:", err);
  }
})();

Example credentials.json

{
  "type": "service_account",
  "project_id": "my-project-id",
  "private_key_id": "123abc456def789ghi...",
  "private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvgIBADANBgkqhkiG9w0BA...\n-----END PRIVATE KEY-----\n",
  "client_email": "[email protected]",
  "client_id": "123456789012345678901",
  "auth_uri": "https://accounts.google.com/o/oauth2/auth",
  "token_uri": "https://oauth2.googleapis.com/token",
  "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
  "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/my-service-account%40my-project-id.iam.gserviceaccount.com"
}

How to Obtain credentials.json

  1. Create a project in the Google Cloud Console
  2. Enable the Google Drive API for your project.
  3. Create a service account under IAM & Admin → Service Accounts.
  4. Generate a JSON key for the service account and download the credentials.json file.

Console Output

🚀 Done! File uploaded:
🔗 Drive Link: https://drive.google.com/drive/folders/1A2bC3D4E5*********

Monthly Upload Output

🚀 Done! File uploaded:
📦 Local File: ./backup-2025-08.zip
🔗 Drive Link: https://drive.google.com/file/d/FILE_ID/view?usp=drives***

Example Error Output

❌ Failed: Error: Invalid credentials

Information

Our module for uploading files to Google Drive is completely free of charge. All data is fully private, and we do not collect any information or make any profit from it.


Thanks To

A special thanks to the following contributors for their support and inspiration:

  • Nathan
  • Finix
  • Syall

Technologies & Tools Used

[NPM] [Google Cloud] [Google Drive] [Google] [Google Database] [Gemini]


Developer

  • Hazel
    Don’t forget to follow my GitHub for future updates: Github