Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

mryan-code-google-docs-to-html

mryan-code448ISC2.0.0

This package converts a Google Doc to HTML.

promise, async, googleapis, Google Docs

readme

Google Doc to HTML

Description

This package converts a Google Doc to HTML.

Note

I'm sure you're already familiar with the googleapis package, and the path package. Incase not, I included a basic example of how to use em below.

Installation

npm i mryan-code-google-docs-to-html googleapis path

Usage

import { google } from "googleapis";
import { googleDocToHTML } from "mryan-code-google-docs-to-html";
const auth = new google.auth.GoogleAuth({
    keyFile: path.resolve("google-service.json"),
    scopes: ["https://www.googleapis.com/auth/documents.readonly"],
});
google.options({
    timeout: 10000,
    auth: auth,
});
const docs = google.docs("v1");
const googleDocResponse = await docs.documents.get("whatever_id");
const googleDocHTMLArray = await googleDocToHTML(googleDocResponse);