0.1.1 • Published 9 months ago

rich-to-word v0.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

rich-to-word

NPM version NPM downloads

Installation

npm install rich-to-word

Use

import richToWord from rich-to-word;

const richText = `<p>hello rich-to-word</p><p><img src="https://avatars.githubusercontent.com/u/8125081?v=4" alt="" data-href="" style=""/></p>`

const blob = await richToWord(html);
const link = document.createElement('a');
const blobUrl = window.URL.createObjectURL(blob);
link.href = blobUrl;
link.download = 'word.docx';
link.click();

or

import { richToWordSave } from 'rich-to-word';
// use file-saver to download

const richText = `<p>hello rich-to-word</p><p><img src="https://avatars.githubusercontent.com/u/8125081?v=4" alt="" data-href="" style=""/></p>`;

richToWordSave(richText, 'word');
// await richToWordSave(richText, 'word');

Options

richToWord(richText, options)

richToWordSave(richText, fileName, options)

Use in Vite

see rich-to-word-vite

LICENSE

MIT

0.1.1

9 months ago

0.1.0

9 months ago

0.0.2

9 months ago

0.0.1

9 months ago