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

@mdgate/converters

v0.6.25

Published

Pure TypeScript converters for 150+ file types to Markdown, including DOCX, PDF, PPTX, XLSX, iWork, HWP, and email. Runs in Node, Edge, and browsers.

Readme

@mdgate/converters

npm downloads License: MIT convert

Real-world files to Markdown, in pure TypeScript.

@mdgate/converters is the complete deterministic reader: one toMarkdown(bytes) for PDF, Word, Excel, PowerPoint, OpenDocument, Apple iWork, HWP, WPS, email, OneNote, Visio, ebooks, archives, and more.

Works in Node.js, Cloudflare Workers, Edge runtimes, and browsers.

No Python. No native addons. No WASM. No third-party runtime dependencies.

npm install @mdgate/converters
import { toMarkdown } from '@mdgate/converters';

const markdown = await toMarkdown(bytes, {
  path: 'report.docx',
});

The input is bytes. The output is Markdown.

Convert a file in your browser. Full docs live in the repository README.


Why @mdgate/converters

A JavaScript application that needs to read real-world files quickly becomes a collection of unrelated parsers.

This package puts them behind one interface:

Uint8Array → Markdown

toMarkdown is create(all()). all() registers every converter that needs no configuration. Raster images, audio, and video need callbacks, so they are exported but not included in all().


One format

If your application only needs one format, install only that converter.

npm install @mdgate/pdf
import { toMarkdown } from '@mdgate/pdf';

const markdown = await toMarkdown(bytes);

Your own set

import { create } from '@mdgate/core';
import { pdf } from '@mdgate/pdf';
import { docx } from '@mdgate/docx';
import { xlsx } from '@mdgate/xlsx';

const read = create([
  pdf(),
  docx(),
  xlsx(),
]);

Or start from all() and add media callbacks:

import { all, create, image } from '@mdgate/converters';
import { ai } from '@mdgate/ai';

const media = ai({
  baseURL: 'https://api.example.com/v1',
  apiKey: process.env.API_KEY!,
  model: 'your-model',
});

const read = create([
  ...all(),
  image(media.convertImage),
]);

Node.js

import { readFile } from 'node:fs/promises';
import { toMarkdown } from '@mdgate/converters';

const bytes = new Uint8Array(await readFile('report.docx'));
const markdown = await toMarkdown(bytes, {
  path: 'report.docx',
});

The optional path is a format hint. The converter never reads that path from disk.


Cloudflare Workers and Edge runtimes

import { toMarkdown } from '@mdgate/converters';

export default {
  async fetch(request: Request) {
    const bytes = new Uint8Array(await request.arrayBuffer());
    const markdown = await toMarkdown(bytes, {
      path: request.headers.get('x-filename') ?? undefined,
    });

    return new Response(markdown, {
      headers: {
        'content-type': 'text/markdown; charset=utf-8',
      },
    });
  },
};

Browser

import { toMarkdown } from '@mdgate/converters';

const file = input.files![0];
const bytes = new Uint8Array(await file.arrayBuffer());

const markdown = await toMarkdown(bytes, {
  path: file.name,
});

Try it in your browser


Packages

| Package | Handles | |---|---| | @mdgate/converters | Bundle: every deterministic format below, toMarkdown, all() | | @mdgate/docx | docx, docm | | @mdgate/doc | doc (binary Word) | | @mdgate/rtf | rtf | | @mdgate/pptx | pptx, pptm, ppsx, ppsm | | @mdgate/ppt | ppt, pps, pot (binary PowerPoint) | | @mdgate/xlsx | xlsx, xlsm, xlsb, xls | | @mdgate/csv | csv | | @mdgate/text | txt, md, and source files | | @mdgate/data | json, jsonl, xml, yaml | | @mdgate/subtitle | srt, vtt, webvtt, ass, lrc, sub, sbv, ttml, jss | | @mdgate/html | html, htm, html4, html5, xhtml, mhtml, mht | | @mdgate/email | eml, msg, mbox, emlx | | @mdgate/ipynb | ipynb (Jupyter) | | @mdgate/odf | odt, ods, odp, odg | | @mdgate/pages | pages | | @mdgate/numbers | numbers | | @mdgate/keynote | key | | @mdgate/epub | epub, ibooks | | @mdgate/pdf | pdf | | @mdgate/fb2 | fb2, fb2.zip | | @mdgate/mobi | mobi, azw, azw3, prc | | @mdgate/latex | tex, latex, ltx | | @mdgate/visio | vsd, vsdx, vss, vst, vssx, vstx | | @mdgate/onenote | one, onetoc2, onepkg | | @mdgate/hwp | hwp, hwpx, hwt, hwtx | | @mdgate/wps | wps, wpt, et, ett, dps, dpt | | @mdgate/zip | zip, zipx, jar | | @mdgate/image | jpeg*, png*, webp*, gif*, tiff*, heic*, bmp*, svg, svgz | | @mdgate/audio | mp3*, wav*, m4a*, aac*, ogg*, flac*, weba* | | @mdgate/video | mp4*, m4v*, mov*, webm*, mkv*, avi* |

* Needs a callback: vision for raster images (image()), transcription for audio (audio()), video understanding for video(). Not registered by all(). SVG converts locally.

@mdgate/converters is the complete reader in the open-source mdgate/converters project.

For AI agents, the same converter architecture can be used to extend read_file from text files to real-world document formats.


License

MIT