# @datagica/read-document

> Extract plain text from any kind of document

Latest version **0.1.2** (published 2018-02-18) · GPL-3.0 license · 0 weekly downloads

## Install

```sh
npm install @datagica/read-document
pnpm add @datagica/read-document
yarn add @datagica/read-document
bun add @datagica/read-document
```

## 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.1.2 |
| Published | 2018-02-18 |
| First published | 2016-05-12 |
| Weekly downloads | 0 |
| License | GPL-3.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 743.7 KB |
| Known vulnerabilities | 0 (+3 in 3 direct dependencies) |
| Install scripts | no |
| Author | Julian Bilcke |
| Maintainers | datagica |

## Links

- npm: https://www.npmjs.com/package/@datagica/read-document
- Repository: https://bitbucket.org/datagica/read-document
- Homepage: https://bitbucket.org/datagica/read-document#readme
- npm.io page: https://npm.io/package/@datagica/read-document

## Dependencies (6)

- [gexf](https://npm.io/package/gexf.md) ^0.2.5
- [p-queue](https://npm.io/package/p-queue.md) ^1.0.0
- [textract](https://npm.io/package/textract.md) ^2.2.0
- [papaparse](https://npm.io/package/papaparse.md) ^4.3.7
- [chrono-node](https://npm.io/package/chrono-node.md) ^1.2.5
- [base64-arraybuffer](https://npm.io/package/base64-arraybuffer.md) ^0.1.5

## Recent versions

- 0.1.2 (latest) — 2018-02-18
- 0.1.1 — 2018-02-18
- 0.1.0 — 2017-07-08
- 0.0.4 — 2016-12-26
- 0.0.2 — 2016-05-15
- 0.0.1 — 2016-05-12
- 0.0.0 — 2016-05-12

## README

# @datagica/read-document

Extract plain text from any kind of document. Based on `textract`.

## Current issues

`read-document` is not thread safe (because it uses `textract`, and `textract` is
  not apparently), so you will have to wait for each promise to complete before
  converting another document, for instance by chaining promises like this:

```javascript

const read = require('@datagica/read-document');

const sequentialPromise = files.reduce((p, file) =>
  p.then(done =>
    read({ file: file }).then(doc => anotherAsyncPromise(doc))
  ),
  Promise.resolve(0)
)

```

## Prerequisites

- PDF extraction requires `pdftotext` be installed
- DOC, RTF extraction requires `catdoc` be installed, unless on OSX in which case `textutil` (installed by default) is used.
- PNG, JPG and GIF require `tesseract` to be available. Images need to be pretty clear, high - DPI and made almost entirely of just text for tesseract to be able to accurately extract the text.
- DXF extraction requires `drawingtotext` be available

---
_Source: https://npm.io/package/@datagica/read-document · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
