🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@markdown-media/wasm

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@markdown-media/wasm

MDM Core — Convert HWP/HWPX/PDF/DOCX to Markdown via WebAssembly. Rust-powered, browser-ready.

latest
Source
npmnpm
Version
0.1.0
Version published
Weekly downloads
2
-33.33%
Maintainers
1
Weekly downloads
 
Created
Source

@markdown-media/wasm

Convert HWP, HWPX, PDF, DOCX to clean Markdown — in the browser or Node.js.

Rust-powered WebAssembly engine. No server required.

Install

npm install @markdown-media/wasm

Quick Start

Browser

<input type="file" id="file" accept=".hwp,.hwpx,.pdf,.docx" />
<pre id="output"></pre>

<script type="module">
  import init, { convert_to_markdown, detect_format } from '@markdown-media/wasm';

  await init();

  document.getElementById('file').addEventListener('change', async (e) => {
    const file = e.target.files[0];
    const data = new Uint8Array(await file.arrayBuffer());

    const format = detect_format(data, file.name);
    console.log('Detected format:', format);

    const markdown = convert_to_markdown(data, file.name);
    document.getElementById('output').textContent = markdown;
  });
</script>

Node.js

import { readFileSync } from 'fs';
import init, { convert_to_markdown, convert_to_json } from '@markdown-media/wasm';

await init();

const data = new Uint8Array(readFileSync('report.hwp'));
const markdown = convert_to_markdown(data, 'report.hwp');
console.log(markdown);

// Or get structured output (format, version, markdown, metadata)
const json = JSON.parse(convert_to_json(data, 'report.hwp'));
console.log(json.metadata);

API

convert_to_markdown(data: Uint8Array, filename: string): string

Convert a document to Markdown. Format is auto-detected from filename and magic bytes.

convert_to_json(data: Uint8Array, filename: string): string

Convert a document to a JSON string:

{
  "format": "hwp",
  "version": "5.0.1.7",
  "markdown": "# Title\n\nContent...",
  "metadata": { "author": "...", "title": "..." }
}

detect_format(data: Uint8Array, filename: string): string

Returns "hwp", "hwpx", "pdf", "docx", or "unknown".

get_version(): string

Returns the engine version.

Supported Formats

FormatExtensionStatus
HWP 5.0.hwpFull support
HWPX.hwpxFull support
PDF.pdfText extraction
DOCX.docxFull support

Also Available

  • Python: pip install mdm-parser (PyPI)
  • CLI: cargo install mdm-core (Rust)
  • Desktop: MDM Desktop (macOS)

License

MIT

Keywords

hwp

FAQs

Package last updated on 16 Apr 2026

Did you know?

Socket

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.

Install

Related posts