
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Convert between HTML and UYAP UDF file format. Designed for AI agents that need to read and write UDF documents programmatically.
UDF is the document format used by UYAP (Turkey's National Judiciary Informatics System). A UDF file is a ZIP archive containing a single content.xml file with text content, formatting, images, and tables encoded in a custom XML schema.
npm install udf-cli
Or run directly:
npx udf-cli html2udf input.html output.udf
udf-cli html2udf <input> [output]
Input accepts a file path, raw HTML string, or - for stdin. If input contains < it is treated as raw HTML. Output is optional — omit it to write to stdout.
# File to file
udf-cli html2udf input.html output.udf
# Raw HTML string to file
udf-cli html2udf '<p><strong>Merhaba</strong> dünya</p>' output.udf
# Raw HTML string to stdout
udf-cli html2udf '<p>Test</p>' > output.udf
# Stdin to file
cat input.html | udf-cli html2udf - output.udf
# Stdin to stdout (pipe-friendly)
echo '<p>Merhaba</p>' | udf-cli html2udf - > output.udf
udf-cli udf2html <input> [output]
Input accepts a file path or - for stdin. Output is optional — omit it to print HTML to stdout.
# File to file
udf-cli udf2html input.udf output.html
# File to stdout (agent-friendly — read UDF content directly)
udf-cli udf2html input.udf
# Stdin to stdout
cat input.udf | udf-cli udf2html -
# Full roundtrip via pipes
echo '<p>Test</p>' | udf-cli html2udf - | udf-cli udf2html -
udf-cli md2udf <input> [output]
Input accepts a file path, raw Markdown string, or - for stdin.
# File to file
udf-cli md2udf input.md output.udf
# Stdin to file
cat input.md | udf-cli md2udf - output.udf
# Raw Markdown via stdin
echo '**Merhaba** dünya' | udf-cli md2udf - output.udf
Supported Markdown syntax for input:
**bold** and *italic*, ***bold italic***# Heading 1 through ###### Heading 61. Numbered list and - Bulleted list (with nesting via indentation)| col1 | col2 | with separator row) imagesudf-cli udf2md <input> [output]
Converts UDF to Markdown — ideal for AI agents that work better with Markdown than HTML. Tables become Markdown tables, bold/italic use **/* syntax, lists become 1./- items.
# Read a UDF file as Markdown (agent-friendly)
udf-cli udf2md input.udf
# Save as Markdown file
udf-cli udf2md input.udf output.md
Example output:
**T.C.**
**ANTALYA 3. ASLİYE HUKUK MAHKEMESİ**
**ESAS NO:** 2024/463
**DAVACI:** Mehmet Yılmaz
| **Sıra No** | **Açıklama** | **Toplam (TL)** |
| --- | --- | --- |
| 1 | Arsa değeri | 1.250.000,00 |
| 2 | Bina değeri | 990.000,00 |
1. Taşınmazın konumu
2. Yapının fiziksel durumu
- Dış cephe boyasında dökülme
- Çatı izolasyonunda bozulma
import { htmlToUdf, udfToHtml, udfToMarkdown, markdownToUdf } from 'udf-cli';
// HTML string → UDF buffer
const udfBuffer = await htmlToUdf('<p><strong>Mahkeme kararı</strong></p>');
fs.writeFileSync('document.udf', udfBuffer);
// UDF buffer → HTML string
const udf = fs.readFileSync('document.udf');
const html = await udfToHtml(udf);
// UDF buffer → Markdown string
const md = await udfToMarkdown(udf);
// Markdown string → UDF buffer
const udfFromMd = await markdownToUdf('**Başlık**\n\nParagraf metni');
| HTML | UDF Mapping |
|---|---|
<p> | Paragraph |
<h1> - <h6> | Paragraph with bold, sizes 24/20/16/14/12/10 pt |
<strong>, <b> | Bold text |
<em>, <i> | Italic text |
<u> | Underlined text |
<span style="..."> | Styled text (font, size, color, background) |
<br> | Paragraph break |
<img src="data:..."> | Embedded image (base64 data URI) |
<table>, <tr>, <td>, <th> | Table with borders (nested tables supported) |
<ul>, <ol>, <li> | Bulleted / numbered lists |
<div> | Block container |
These inline styles are recognized on <p>, <span>, <td>:
font-family — mapped to UDF font familyfont-size — supports px (converted to pt) and ptfont-weight: bold — bold textfont-style: italic — italic texttext-decoration: underline — underlined textcolor — text color (hex, rgb, named colors)background-color — text/cell backgroundtext-align — left, center, right, justifyvertical-align — top, middle, bottom (table cells)line-height — paragraph line spacingWhen generating HTML that will be converted to UDF, follow these guidelines:
<p>Normal text</p>
<p><strong>Bold text</strong></p>
<p><em>Italic text</em></p>
<p><strong><em>Bold and italic</em></strong></p>
<p><span style="font-family:Arial; font-size:14pt; color:#FF0000">Custom styled text</span></p>
Images must use base64 data URIs. Specify width and height in points:
<img src="data:image/png;base64,iVBORw0KGgo..." width="200" height="100">
<table>
<tr>
<td>Cell 1</td>
<td>Cell 2</td>
</tr>
<tr>
<td colspan="2">Merged cell</td>
</tr>
</table>
Nested tables are supported:
<table>
<tr>
<td>
<table>
<tr><td>Inner cell</td></tr>
</table>
</td>
</tr>
</table>
<ol>
<li>First item</li>
<li>Second item</li>
</ol>
<ul>
<li>Bullet point</li>
<li>Another point</li>
</ul>
<p style="text-align:center">Centered paragraph</p>
<p style="text-align:right">Right-aligned paragraph</p>
<p style="text-align:justify">Justified paragraph</p>
UDF files have this internal structure:
document.udf (ZIP archive)
└── content.xml
The XML schema:
<?xml version="1.0" encoding="UTF-8" ?>
<template format_id="1.8">
<content><![CDATA[All document text here]]></content>
<properties>
<pageFormat mediaSizeName="1" leftMargin="42.52" rightMargin="28.35"
topMargin="14.17" bottomMargin="14.17" paperOrientation="1" />
</properties>
<elements resolver="hvl-default">
<paragraph Alignment="0">
<content startOffset="0" length="5" family="Times New Roman"
size="12" bold="true" foreground="-16777216" background="-1" />
</paragraph>
<table tableName="Sabit" columnCount="2" columnSpans="150,150" border="borderCell">
<row rowName="row1" rowType="dataRow" border="borderCell">
<cell colspan="1" align="top" fillColor="16777215"
border="borderCell" borderSpec="15">
<paragraph>...</paragraph>
</cell>
</row>
</table>
</elements>
</template>
Key details:
imageData attribute, \uFFFC placeholder in text\u200B (zero-width space) placeholder in textnpm install
npm test # run tests
npm run build # compile TypeScript
FAQs
Convert between HTML/Markdown and UYAP UDF file format
We found that udf-cli demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.