1.0.6 • Published 1 year ago

docx-react v1.0.6

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

docx-react

A JSX wrapper around docx for creating docx files.

Install

npm install docx-react

Built with and Requires ESM

Usage

import docx from 'docx';
import { promises as fs } from 'fs';

const { Document, Packer } = docx;

const DocxDoc = () => (
  <section>
    <p thematicBreak spacing={{ before: 100 }}>
      Hello World!
    </p>

    <p>I just created a docx file using JSX!</p>
  </section>
);

(async function () {
  const doc = new Document({
    sections: [DocxDoc()],
  });

  const buffer = await Packer.toBuffer(doc);
  await fs.writeFile('file.docx', buffer);
})();

License

This project is licensed with the MIT license

1.0.6

1 year ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago