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

@goobits/gdoc-to-md

v1.2.0

Published

Convert Google Drive files (Docs to Markdown, Sheets to CSV) using Google Drive API and Pandoc

Readme

🔄 GDrive to MD/CSV

Convert Google Drive files to local formats:

  • 📝 Google Docs → Markdown (.md)
  • 📊 Google Sheets → CSV (.csv)

🚀 Quick Start

npm install -g @goobits/gdoc-to-md
gdoc-to-md /path/to/google/drive/files

✨ Features

  • Converts files in-place (next to originals)
  • Preserves directory structure
  • Adds YAML frontmatter to Markdown
  • Handles special characters
  • Detailed conversion reports

⚙️ Prerequisites

  1. Node.js >= 14.0.0
  2. Python 3 with pip
  3. Pandoc for Docs conversion
  4. Google API credentials (credentials.json)

🛠️ Setup

1. Install the Package

npm install -g @goobits/gdoc-to-md

2. Install Pandoc

# macOS
brew install pandoc

# Ubuntu/Debian
sudo apt install pandoc

# Windows
choco install pandoc

3. Get Google API Credentials

  1. Go to Google Cloud Console
  2. Enable Google Drive API
  3. Create OAuth client ID (Desktop app)
  4. Download as credentials.json
  5. Use one of these methods:
    • Place in your working directory
    • Use --credentials-path flag
    • Use --client-id and --client-secret flags

📋 Usage

Basic

gdoc-to-md /path/to/files

Credentials Options

# Default: looks for credentials.json in current directory
gdoc-to-md /path/to/files

# Custom file path
gdoc-to-md /path/to/files --credentials-path ~/.config/gdoc/creds.json

# Inline credentials (no file needed!)
gdoc-to-md /path/to/files --client-id YOUR_CLIENT_ID --client-secret YOUR_CLIENT_SECRET

Options

gdoc-to-md --gdoc-only         # Only Google Docs
gdoc-to-md --gsheet-only       # Only Google Sheets
gdoc-to-md --skip-existing     # Skip converted files
gdoc-to-md --keep-intermediates # Keep DOCX files
gdoc-to-md --dry-run           # Preview only
gdoc-to-md --limit 5           # Process first 5 files
gdoc-to-md --credentials-path ~/.config/gdoc/creds.json  # Custom credentials path
gdoc-to-md --client-id YOUR_ID --client-secret YOUR_SECRET  # Inline credentials

📂 Output

Google Docs → Markdown

---
title: "Document Title"
source_doc_id: "google_doc_id"
source_url: "https://docs.google.com/..."
converted_on: "2024-01-15 10:30:00"
---

Your document content in Markdown...

Google Sheets → CSV

Direct CSV export preserving all data and structure.

🔐 Security

  • Read-only Google Drive access
  • Local token storage (token.pickle)
  • Never commit credentials.json
  • Credentials excluded from npm package

🤝 Contributing

  1. Fork the repository
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

📄 License

MIT License - see LICENSE file


Made with ❤️ by mudcube