# node-odt

> .odt generator working with templates and data (like Mustache)

Latest version **1.0.1** (published 2017-12-18) · ISC license · 0 weekly downloads

## Install

```sh
npm install node-odt
pnpm add node-odt
yarn add node-odt
bun add node-odt
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2017-12-18 |
| First published | 2017-12-17 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | YU Qiang |
| Maintainers | yuqiangcn |
| Keywords | odt, templates, generation |

## Links

- npm: https://www.npmjs.com/package/node-odt
- Repository: https://github.com/yuqiangcn/odt
- Homepage: https://github.com/yuqiangcn/odt#readme
- Issues: https://github.com/yuqiangcn/odt/issues
- npm.io page: https://npm.io/package/node-odt

## Dependencies (2)

- [jszip](https://npm.io/package/jszip.md) ^3.1.5
- [bluebird](https://npm.io/package/bluebird.md) ^3.5.1

## Recent versions

- 1.0.1 (latest) — 2017-12-18
- 1.0.0 — 2017-12-18
- 0.0.1 — 2017-12-17

## README

# node-odt

OpenDocument Text(.odt) generator working with templates and data (like Mustache)

## Install

```
  $ npm install node-odt
```

## Usage

Template:
```odt
Prenom: {prenom},
Nom: {nom},
Numero: {contact_numero}
```

Code:
```js


const data = {
    nom: "Docy",
    prenom: "Daniel",
    contact:{
        numero:"12345678"
    }
};

const file = fs.createReadStream(path.resolve("./test", "test.odt"));

//file can be a stream or a buffer
const odtHandle = new odtTemplate(file);

//Output type: "nodebuffer", "base64", "stream"
odtHandle
    .renderDoc(data, { type: "stream" })
    .then((res) => {
        // fs.writeFileSync("output.odt", res);
        res.pipe(fs.createWriteStream("output.odt"));
    });


```
Output odt file:
```odt
Prenom: Daniel,
Nom: Docy,
Numero: 12345678
```

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