npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@markdown-media/core

v2.0.0

Published

Native Node.js bindings for mdm-core — convert HWP / HWPX / PDF / DOCX to Markdown with a unified bytes/path API

Readme

@markdown-media/core

Native Node.js bindings for MDM — convert HWP / HWPX / PDF / DOCX documents to Markdown using the Rust core engine, with zero filesystem access when you already have bytes in memory.

npm install @markdown-media/core

Unified document API

Four formats, three entry points, auto-detection from filename extension and/or magic bytes. Same behavior as the WASM build (used in the Chrome extension) and the Python bindings — one Rust core, multiple languages.

const {
  convertFile,
  convertBytes,
  convertToJson,
  detectFormat,
  getVersion,
} = require('@markdown-media/core');

// Path API — reads the file for you
const md = convertFile('./report.hwpx');

// Bytes API — for uploads, streams, serverless
const fs = require('node:fs');
const data = fs.readFileSync('./report.pdf');
const md2 = convertBytes(data, 'report.pdf');

// Format detection — extension first, magic bytes as fallback
detectFormat(data, 'report.pdf');    // => 'pdf'
detectFormat(data, 'no-extension');  // => 'pdf' (from %PDF magic)
detectFormat(Buffer.from('junk'), 'x.xyz'); // => 'unknown'

// Structured output with metadata
const json = JSON.parse(convertToJson(data, 'report.pdf'));
// {
//   format: 'pdf',
//   version: '1.7',
//   markdown: '...',
//   metadata: { page_count, title, author, image_count, ... }
// }

getVersion(); // '1.0.0'

Supported formats

| Ext | Detection | Notes | |---|---|---| | .hwp | extension, OLE magic D0 CF 11 E0 | Hancom HWP5 (CFB) | | .hwpx | extension, ZIP + Contents/ entry | Hancom HWPX (OWPML) | | .pdf | extension, %PDF magic | Layout-aware extraction | | .docx | extension, ZIP + word/ entry | OOXML |

convertBytes and convertToJson throw on unknown formats rather than guessing.

When to use which entry point

  • convertFile(path) — CLI tools, batch scripts. Reads the file for you.
  • convertBytes(buffer, filename) — HTTP upload handlers, serverless functions (Lambda/Render), in-memory pipelines. No temp file round-trip, no cleanup.
  • convertToJson(buffer, filename) — when you also want structured metadata (page counts, tables, images, author). Returns a JSON string.
  • detectFormat(buffer, filename) — cheap pre-flight check; decide routing or reject early without parsing.

Low-level API

The unified functions are built on top of format-specific parsers, which remain exported for callers that need the raw structures:

const {
  parseHwpFile,     // { text, tables }
  parseHwpxFile,    // string (joined sections)
  parseAnnexText,   // Korean legal "[별표 N]" extraction
  parseAnnexHwp,
  parseAnnexHwpx,
  parseDate,        // Korean date parsing → YYYYMMDD
  parseDateWithReference,
  createChainPlan,  // Legal research chain planner
  aggregateChainResults,
} = require('@markdown-media/core');

See index.d.ts for full TypeScript definitions.

Platform support

Native binaries are distributed as optional dependencies; npm picks the right one for your platform:

  • darwin-arm64 (Apple Silicon)
  • darwin-x64 (Intel Mac)
  • linux-x64-gnu
  • linux-arm64-gnu

License

MIT