# text-extractors

> A text extractor for extracting text from HTML, PDF, Image and other files.

Latest version **0.2.0** (published 2024-05-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install text-extractors
pnpm add text-extractors
yarn add text-extractors
bun add text-extractors
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2024-05-17 |
| First published | 2023-03-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=14.16 |
| Dependencies | 7 |
| Unpacked size | 70 KB |
| Known vulnerabilities | 0 (+24 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Bui Thai Binh |
| Maintainers | binhbv |

## Links

- npm: https://www.npmjs.com/package/text-extractors
- Repository: https://github.com/buithaibinh/text-extractors
- Homepage: https://github.com/buithaibinh/text-extractors#readme
- Issues: https://github.com/buithaibinh/text-extractors/issues
- npm.io page: https://npm.io/package/text-extractors

## Dependencies (7)

- [axios](https://npm.io/package/axios.md) ^0.27.2
- [iconv-lite](https://npm.io/package/iconv-lite.md) ^0.6.3
- [pdfjs-dist](https://npm.io/package/pdfjs-dist.md) ^3.4.120
- [content-type](https://npm.io/package/content-type.md) ^1.0.4
- [html-to-text](https://npm.io/package/html-to-text.md) ^8.2.1
- [tesseract.js](https://npm.io/package/tesseract.js.md) ^3.0.3
- [detect-file-type](https://npm.io/package/detect-file-type.md) ^0.2.8

## Recent versions

- 0.2.0 (latest) — 2024-05-17
- 0.1.7 — 2024-05-08
- 0.1.6 — 2024-05-08
- 0.1.5 — 2024-05-08
- 0.1.4 — 2024-05-08
- 0.1.3 — 2023-03-27
- 0.1.2 — 2023-03-27
- 0.1.1 — 2023-03-27
- 0.1.0 — 2023-03-27
- 0.0.12 — 2023-03-27
- 0.0.11 — 2023-03-27
- 0.0.10 — 2023-03-27
- 0.0.9 — 2023-03-27
- 0.0.8 — 2023-03-27
- 0.0.7 — 2023-03-24
- … 5 more at https://npm.io/package/text-extractors/versions

## README

# text-extractors

A text extractor for extracting text from HTML, PDF, Image and other files.

## Currently supported types ...

* HTML, use [html-to-text](https://www.npmjs.com/package/html-to-text)
* PDF, use [pdfjs](https://github.com/mozilla/pdf.js)
* Image (PNG, JPEG, GIF, BMP, TIFF, ICO, SVG). Use [tesseract.js](https://github.com/naptha/tesseract.js#tesseractjs) for OCR.
* ... and more to come

## Installation

```bash
npm install text-extractors
```

## Usage

CommonJS

```js
const { fromUrl, fromBufferWithMimeType, fromBuffer } = require('text-extractors');

// fromUrl
const text = await fromUrl('https://www.digital.go.jp/assets/contents/node/basic_page/field_ref_resources/d6cfdcdd-75e4-460c-9ec0-af4f952e03d5/20210906_meeting_promoting_01.pdf');

// fromBufferWithMimeType
const text = await fromBufferWithMimeType(buffer, 'image/png');

// fromBuffer
const text = await fromBuffer(buffer);
```

ES6

```js
import { fromUrl, fromBufferWithMimeType, fromBuffer } from 'text-extractors';

```

## Roadmap

* [ ] Add support for more file types
* [ ] Add support for options passed to the underlying libraries

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