Fetches a Google Docs document as formatted, inlineable HTML, preserving styles (bold, italics, colors), images, and URLs while stripping page width for reflow. Currently at version 0.0.3 (pre-1.0), this small Node.js library uses a callback-based API and requires the document to be publicly shareable. Key differentiator: simplified extraction of Docs content into HTML without full Google Drive API setup, though limited to public documents.
npm install google-docs-fetchNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Fetches a publicly shared Google Docs document by ID and logs the resulting HTML with inline CSS.
Change sharing settings in Google Docs to 'Anyone with the link can view'.
Use CommonJS require; or use dynamic import() if needed, but note package does not export ESM.
Manually promisify the callback (see Problems section for code).
Verify document ID from the URL (exact match).
Implement your own retry/backoff for multiple fetches.
Ensure document ID is correct and sharing is set to 'Anyone with the link can view'.
Use CommonJS require: var fetch = require('google-docs-fetch');Use callback pattern or promisify: const content = await new Promise((res, rej) => fetch(id, (e, c) => e ? rej(e) : res(c)));
Use createRequire from 'module': import { createRequire } from 'module'; const require = createRequire(import.meta.url); const fetch = require('google-docs-fetch');No dependency data recorded yet.