Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
editor-to-word
Advanced tools
[`Editor-to-Word`](https://www.npmjs.com/package/editor-to-word) is a tool to export rich-text editor content as word file (.docx) by browser 🎉.
Readme
Editor-to-Word
is a tool to export rich-text editor content as word file (.docx) by browser 🎉.
npm i editor-to-word
# or pnpm add editor-to-word
# or yarn add editor-to-word
In web project:
import { exportHtmlToDocx } from 'editor-to-word';
const html = '<p>hello <span style="color: #999">world</span></p>';
exportHtmlToDocx(html, 'testFileName');
For different default style set you can provider the custom paper layout and styleMap like:
// default paper layout
export const D_Layout: IPageLayout = {
bottomMargin: '2.54cm',
leftMargin: '3.18cm',
rightMargin: '3.18cm',
topMargin: '2.54cm',
orientation: PageOrientation.PORTRAIT,
};
// style with tag
export const D_TagStyleMap = {
p: 'line-height: 1.5;',
strong: 'font-weight: bold;',
em: 'font-style: italic;',
u: 'text-decoration: underline;',
del: 'text-decoration: line-through;',
h1: 'font-weight: bold; font-size: 40px; line-height: 1.5;',
h2: 'font-weight: bold; font-size: 36px; line-height: 1.5;',
h3: 'font-weight: bold; font-size: 24px; line-height: 1.5;',
h4: 'font-weight: bold; font-size: 18px; line-height: 1.5;',
h5: 'font-weight: bold; font-size: 15px; line-height: 1.5;',
h6: 'font-weight: bold; font-size: 13px; line-height: 1.5;',
};
const options = {
layout: D_Layout,
tagStyleMap: D_TagStyleMap,
};
exportHtmlToDocx = ('<p>Hi there!</p>', 'doc', options);
And if you don't provider the options it will use the default preset.
FAQs
[`Editor-to-Word`](https://www.npmjs.com/package/editor-to-word) is a tool to export rich-text editor content as word file (.docx) by browser 🎉.
The npm package editor-to-word receives a total of 0 weekly downloads. As such, editor-to-word popularity was classified as not popular.
We found that editor-to-word demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.