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

@braidhq/source-loader-gdrive

v0.4.2

Published

Google Drive source-loader plugin for Braid. Export docs from Google Drive, requires OAuth on first use.

Readme

@braidhq/source-loader-gdrive

Braid keeps a product's intent and its code aligned in one knowledge graph, and lets plugins feed that graph from outside sources. @braidhq/source-loader-gdrive is the plugin that exports Google Docs from a Drive folder as markdown, so a team's design docs become a Braid source.

Role

The drive loader walks a Drive folder, exports every Google Doc it finds as markdown, and keeps a manifest so later syncs touch only what changed.

  • The Export: Each doc is exported to <destination>/<sanitised-title>/index.md, and its inlined base64 images are decoded into sibling files, so the markdown stays readable for humans and models.
  • The Manifest: A .braid-gdrive-manifest.json records each doc's id, title, and modified time, so sync can add, update, rename, or remove docs against the prior state instead of re-downloading everything.
  • The Auth: A fresh OAuth access token is resolved per workspace and source through an injected callback, so credentials stay in the composition root, never in config.

Structure

src/
├── GoogleDriveSourceLoaderPlugin.ts   the gdrive loader, config, walk, export, manifest-diff sync
├── DriveClient.ts                     the Drive REST client, list children and export a doc
├── Manifest.ts                        the on-disk sync-state manifest, read and write
└── index.ts                           re-exports the factory and its config type
  • GoogleDriveSourceLoaderPlugin: The createGoogleDriveLoader factory. It walks the folder, filters by title, exports each doc, extracts inline images, and diffs against the manifest on sync.
  • DriveClient: The thin Drive REST wrapper, listing folder children and exporting a doc to a given mime type.
  • Manifest: The read and write of .braid-gdrive-manifest.json, the record sync diffs against.

Export and Layout

Drive folder hierarchy is flattened. Every matched doc lands in its own directory directly under the destination, named from the sanitised Drive title, so two docs that sanitise to the same name collide and one must be renamed in Drive. Auto-created Copy of duplicates are skipped, and title include and exclude regexes narrow what is exported while subfolders are still traversed when recursive is set.

Only Google Docs are in scope. Sheets, Slides, Drawings, and Forms are left for a different plugin. The folderId alias root is rejected outright, since it would mirror an entire My Drive.

Boundaries

  • Owns Its Directory: The destination and its manifest are the loader's to write. Provision wipes and rebuilds it, sync reconciles it against Drive.
  • No Credentials On Disk: The access token is resolved at run time through the injected callback. Only exported markdown and images land in the destination.
  • A Plugin, Not A Service: It implements core's SourceLoader port through the sdk factory, and depends on the host to supply OAuth token resolution.

Dependencies

  • Depends On: @braidhq/core for the port, @braidhq/schema for shared types, @braidhq/sdk for the factory, and zod.
  • Consumed By: The server composition root, where composeFsApp registers the gdrive loader and wires resolveAccessToken to its OAuth store.