# google-docs-fetch

> Fetch a Google Docs document as formatted, inlineable HTML.

Latest version **0.0.3** (published 2017-01-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install google-docs-fetch
pnpm add google-docs-fetch
yarn add google-docs-fetch
bun add google-docs-fetch
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2017-01-01 |
| First published | 2016-06-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Zachary Liu |
| Maintainers | zacharyliu |

## Links

- npm: https://www.npmjs.com/package/google-docs-fetch
- Repository: https://github.com/zacharyliu/google-docs-fetch
- Homepage: https://github.com/zacharyliu/google-docs-fetch#readme
- Issues: https://github.com/zacharyliu/google-docs-fetch/issues
- npm.io page: https://npm.io/package/google-docs-fetch

## Dependencies (3)

- [css](https://npm.io/package/css.md) ^2.2.1
- [cheerio](https://npm.io/package/cheerio.md) ^0.20.0
- [request](https://npm.io/package/request.md) ^2.72.0

## Recent versions

- 0.0.3 (latest) — 2017-01-01
- 0.0.2 — 2016-06-08
- 0.0.1 — 2016-06-08

## README

# google-docs-fetch
Fetch a Google Docs document as formatted, inlineable HTML.

* Preserves (inline) document formatting, including bold/italics, colors, and more
* Strips page width to reflow text into your own container
* Maintains original URLs and uploaded images

## Installation
`npm install google-docs-fetch`

## Usage
Ensure that your document has link sharing on and set to be viewable by "Anyone wth the link". Retrieve your document ID (shown here as `YOUR-DOC-ID`) from the generated link:

`https://docs.google.com/document/d/YOUR-DOC-ID/edit?usp=sharing`

In your script, you can then retrieve the contents of the document as HTML:

```js
var fetch = require('google-docs-fetch');

fetch('YOUR-DOC-ID', function (err, content) {
  if (!err) {
    console.log(content);
  }
});
```

The resulting HTML will resemble the following format, using a wrapper class to scope CSS styles:

```html
<style type="text/css">
.page-content-YOUR-DOC-ID ... {...}
</style>
<div class="page-content-YOUR-DOC-ID">
...
</div>

---
_Source: https://npm.io/package/google-docs-fetch · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
