docs-markdown-fork
v1.2.4
Published
Opinionated starter for Node.js + TypeScript libraries
Downloads
6
Maintainers
Readme
📝 Docs Markdown
Convert a Google Docs file (API response) to Markdown
💡 Usage
Install the package from npm:
npm install docs-markdown
Import and use:
import { googleDocsToMarkdown } from "docs-markdown";
import { google } from "googleapis";
import { writeFileSync } from "fs";
const oauth2Client = new google.auth.OAuth2(); // Authenticate
const docs = google.docs("v1");
const file = await docs.documents.get({
documentId: "Google Docs document ID",
auth: oauth2Client,
});
const markdown = googleDocsToMarkdown(file.data);
writeFileSync("file.md", markdown);
⭐️ Features
- [x] Paragraphs
- [x] Headings, titles, subtitles
- [x] Bold, italic
- [x] Lists
- [x] Links
- [ ] Images
- [ ] Tables
- [ ] Header, footer
👩💻 Development
Build TypeScript:
npm run build