# libreoffice-convert

> A simple and fast node.js module for converting office documents to different formats

Latest version **1.8.2** (published 2026-07-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install libreoffice-convert
pnpm add libreoffice-convert
yarn add libreoffice-convert
bun add libreoffice-convert
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 1.8.2 |
| Published | 2026-07-04 |
| First published | 2014-09-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=6 |
| Dependencies | 2 |
| Unpacked size | 21.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 314 |
| Maintainers | elwerene |
| Keywords | Libreoffice, convert, Excel, Word, xlsx, xls, doc, docx, pdf |

## Links

- npm: https://www.npmjs.com/package/libreoffice-convert
- Repository: https://github.com/elwerene/libreoffice-convert
- Homepage: https://github.com/elwerene/libreoffice-convert#readme
- Issues: https://github.com/elwerene/libreoffice-convert/issues
- npm.io page: https://npm.io/package/libreoffice-convert

## Dependencies (2)

- [tmp](https://npm.io/package/tmp.md) ^0.2.1
- [async](https://npm.io/package/async.md) ^3.2.3

## Alternatives

- [@cantoo/pdf-lib](https://npm.io/package/@cantoo/pdf-lib.md) — 297.9K weekly downloads
- [datatables.net-buttons](https://npm.io/package/datatables.net-buttons.md) — 200.1K weekly downloads
- [@ckeditor/ckeditor5-export-pdf](https://npm.io/package/@ckeditor/ckeditor5-export-pdf.md) — 167.0K weekly downloads
- [scanbot-web-sdk](https://npm.io/package/scanbot-web-sdk.md) — 15.0K weekly downloads
- [@syncfusion/ej2-angular-pdfviewer](https://npm.io/package/@syncfusion/ej2-angular-pdfviewer.md) — 8.8K weekly downloads

## Recent versions

- 1.8.2 (latest) — 2026-07-04
- 1.8.1 — 2026-01-29
- 1.8.0 — 2026-01-28
- 1.7.0 — 2025-09-08
- 1.6.1 — 2025-02-27
- 1.6.0 — 2024-07-22
- 1.5.1 — 2023-12-10
- 1.5.0 — 2023-11-05
- 1.4.1 — 2022-05-18
- 1.4.0 — 2022-05-15
- 1.3.8 — 2022-03-29
- 1.3.7 — 2022-03-29
- 1.3.6 — 2022-03-29
- 1.3.5 — 2021-11-22
- 1.3.4 — 2021-11-18
- … 18 more at https://npm.io/package/libreoffice-convert/versions

## README

# libreoffice-convert

A simple and fast node.js module for converting office documents to different formats.

## Dependency

Please install libreoffice in /Applications (Mac), with your favorite package manager (Linux), or with the msi (Windows)
(On Windows, add `PROGRAMFILES` environment variable for Windows program files path to your local project)

## Usage example

```javascript
'use strict';

const path = require('path');
const fs = require('fs').promises;

const libre = require('libreoffice-convert');
libre.convertAsync = require('util').promisify(libre.convert);

async function main() {
    const ext = '.pdf'
    const inputPath = path.join(__dirname, '/resources/example.docx');
    const outputPath = path.join(__dirname, `/resources/example${ext}`);

    // Read file
    const docxBuf = await fs.readFile(inputPath);

    // Convert it to pdf format with undefined filter (see Libreoffice docs about filter)
    let pdfBuf = await libre.convertAsync(docxBuf, ext, undefined);
    
    // Here in done you have pdf file which you can save or transfer in another stream
    await fs.writeFile(outputPath, pdfBuf);
}

main().catch(function (err) {
    console.log(`Error converting file: ${err}`);
});
```

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