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

filetomarkdown

v0.6.9

Published

Convert various file types to markdown format with browser and Node.js support

Readme

CommandsAPI ReferenceBrowser UsageFile Types

FileToMarkdown

Convert files to Markdown format. Supports Office documents, PDFs, code files, and archives.

Quick Start

Install

npm install -g filetomarkdown

Usage

Command Line

# Test conversions with example files
filetomarkdown-test

# Convert single file
filetomarkdown input.docx output.md

# Start API server
filetomarkdown-server

# List supported file types
filetomarkdown-filetypes

# Download and launch Markdown Viewer (auto-installs)
filetomarkdown-viewer

Node.js API

JavaScript

const { convertToMarkdown } = require('filetomarkdown');

// Convert to string
const markdown = await convertToMarkdown('document.pdf');

// Convert to file
await convertToMarkdown('document.pdf', 'output.md');

TypeScript

import { MarkitDown, convertToMarkdown } from 'filetomarkdown';

// Using the class with options
const converter = new MarkitDown({ collapsible: true });
const markdown = await converter.convertToMarkdown('document.pdf');

// Using the convenience function
const result = await convertToMarkdown('document.pdf', 'output.md');

Browser (API Client)

<script src="https://unpkg.com/filetomarkdown"></script>
<script>
  // Create client instance (requires filetomarkdown-server running)
  const client = new FileToMarkdown.FileToMarkdownClient();
  client.baseURL = 'http://localhost:3000';
  
  // Convert file via API
  client.convertFile(file).then(result => {
    console.log(result.markdown);
  });
</script>

Available Commands

After installation, you get these commands:

  • filetomarkdown - Convert files to markdown
  • filetomarkdown-server - Start API server on port 3000
  • filetomarkdown-test - Run conversion tests with example files
  • filetomarkdown-filetypes - List all supported file formats
  • filetomarkdown-viewer - Download and launch standalone Markdown Viewer

Features

  • ✅ Preserves formatting (tables, lists, headings)
  • ✅ Syntax highlighting for code
  • ✅ Archive extraction and conversion
  • ✅ CLI and API support
  • ✅ Browser compatible
  • ✅ TypeScript support
  • ✅ 60+ file formats supported

Markdown Viewer

For viewing and editing the converted markdown files, use our standalone Markdown Viewer application:

  • 🚀 Quick Install & Launch: filetomarkdown-viewer (auto-downloads and runs)
  • 📱 Manual Download: Download Latest Release
  • 🎯 Features: File browser, live preview, syntax highlighting, and editing capabilities
  • 💻 Platform: Windows executable (no installation required)
  • 🔗 Repository: Markdown-Viewer
  • 🔄 Auto-updates: The viewer command automatically downloads the latest version

Easiest way: Just run filetomarkdown-viewer after installing the package - it installs and launches automatically!

Examples

PDF → Markdown

filetomarkdown report.pdf report.md

Word Document → Markdown

filetomarkdown presentation.docx presentation.md

ZIP Archive → Multiple Files

filetomarkdown archive.zip
# Creates markdown files for each supported file in the archive

Start API Server

filetomarkdown-server
# Server runs on http://localhost:3000
# API endpoints: /api/convert, /api/filetypes, /health

License

MIT