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

@corsair-dev/googledocs

v0.1.1

Published

Google Docs plugin for Corsair

Readme

@corsair-dev/googledocs

Google Docs plugin for Corsair. Covers document creation and editing, text operations, document structure (headers, footers, footnotes, named ranges, bullets), tables, and Drive-watch based triggers.

Authentication

The plugin uses OAuth 2.0 (oauth_2) against Google.

  1. Create a project in the Google Cloud Console and enable the Google Docs API and the Google Drive API (Drive powers search, export, copy, and the change-watch triggers).
  2. Configure an OAuth consent screen and create an OAuth client ID (type: Web application). Add your Corsair callback URL as an authorized redirect URI.
  3. Supply the client ID and secret to Corsair; the OAuth flow requests these scopes:
    • https://www.googleapis.com/auth/documents
    • https://www.googleapis.com/auth/drive

Access tokens are refreshed automatically before expiry and requests are retried once on 401.

Endpoints

35 operations across these domains:

| Domain | Operations | | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | documents | createDocument, createBlankDocument, createDocumentMarkdown, copyDocument, getDocument, getDocumentPlaintext, updateDocumentMarkdown, updateDocumentSectionMarkdown, updateDocumentStyle, updateExistingDocument, updateDocumentBatch, exportDocumentAsPdf, searchDocuments, listSpreadsheetCharts | | text | insertText, replaceAllText, deleteContentRange, insertInlineImage, replaceImage, insertPageBreak | | structure | createHeader, createFooter, createFootnote, createNamedRange, createParagraphBullets, deleteParagraphBullets, deleteHeader, deleteFooter, deleteNamedRange | | tables | insertTable, insertTableColumn, deleteTableColumn, deleteTableRow, unmergeTableCells, updateTableRowStyle |

Triggers (webhooks)

Google Docs has no native push API, so triggers ride on a Google Drive changes watch channel narrowed to Docs mime types. Supported events:

documentCreated, documentUpdated, documentDeleted, documentAdded, documentStructureChanged, documentWordCountThreshold, documentPlaceholderFilled, keywordDetected, docChanged, folderCreated

Drive watch channels expire (max ~24h) and must be renewed. Create the channel via the Drive API (changes.watch) with a channel ID prefixed googledocs- — the plugin's webhook matcher requires that prefix to tell Docs deliveries apart from googledrive, which rides the same changes feed. The webhook handler resumes from the stored page token on each notification.

Provider quirks

  • Document edits go through documents.batchUpdate; the granular endpoints (insert/replace/delete text, headers, tables, ...) build the batch requests internally.
  • Markdown import/update works by converting markdown into batch update requests — complex markdown (nested tables, raw HTML) degrades to plain text.
  • exportDocumentAsPdf and searchDocuments use the Drive API, not the Docs API.
  • Index positions in the Docs API are 1-based UTF-16 offsets; ranges for delete operations must not span segment boundaries.