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-docx-translated-ai

v1.0.3

Published

A CLI tool to translate markdown and docx files using AI

Readme

Markdown DOCX Translated AI

A TypeScript CLI tool to translate markdown and .docx files while preserving structure, formatting, and images.

Features

Markdown Translation

  • Folder translation support - Translate all markdown files in a folder recursively
  • Mass translation support - Translate to multiple languages using a language file
  • Concurrent processing - Fast translation using parallel section processing (up to 5x faster)
  • Folder structure preservation - Maintains original folder structure in language-specific output folders
  • Support for complex markdown with multiple heading levels
  • Always includes empty sections with trimmed whitespace
  • Comprehensive test coverage

.docx Translation (NEW!)

  • Full .docx support - Translate Microsoft Word documents while preserving formatting
  • Image preservation - Extracts, preserves, and embeds images throughout translation
  • Formatting preservation - Maintains bold, italic, headers, lists, and other formatting
  • Error recovery - Graceful handling of context length exceeded errors

Usage

Translate Markdown Files

# Translate all markdown files in a folder to Spanish
mdta translate-md ./docs -t "Spanish"

# Translate to multiple languages with custom output folder
mdta translate-md ./docs -t "languages.txt" -o "translated-docs"

# Use custom concurrency and model
mdta translate-md ./docs -t "French" -c 5 -m "openai/gpt-4o"

# Output JSON format for all files
mdta translate-md ./docs -t "Chinese" --json

# more about commands
mdta -h

Translate .docx Files (NEW!)

# Translate all .docx files in a folder to Spanish
mdta translate-docx ./documents -t "es" -o "translated-docs"

# Translate to multiple languages with custom concurrency
mdta translate-docx ./documents -t "languages.txt" -o "output" -c 3

# Preserve formatting and include images
mdta translate-docx ./documents -t "fr" --preserve-formatting --include-images

# Use specific AI model for translation
mdta translate-docx ./documents -t "de" -m "openai/gpt-4o"

Example folder structure:

input-folder/
├── README.md
├── document.docx
├── docs/
│   └── api.md
└── guides/
    └── quickstart.docx

# After translation to Spanish:
translated/
└── es/
    ├── README.md
    ├── document.docx
    ├── docs/
    │   └── api.md
    └── guides/
        └── quickstart.docx

# For .docx-only translation:
translated-docx/
└── es/
    ├── document.docx
    └── guides/
        └── quickstart.docx

Language Files

For mass translation, create a language file (e.g., languages.txt) with one language per line:

# Target languages (one per line)
# Lines starting with # are comments
spanish
french
chinese
japanese
german

When using a language file, the tool will:

  • Generate separate output files for each language
  • Language codes are supported: 2-letter codes (e.g., "en", "es", "fr", "de") and locale format (e.g., "en-US", "es-ES", "fr-FR").

Note: You can pass language names or codes to -t. Codes are case-insensitive and support both 2-letter and locale formats, e.g., en, en-US, or en-Us.

Environment Setup

Set up your API key (OpenRouter is currently the only supported provider) or use an .env file:

export OPENROUTER_API_KEY="your-api-key-here"

Note: Currently only OpenRouter API keys are supported for AI translation services.

💼 Support & Hiring

If this project is helpful to you, please help by sharing this tool or hiring me(I need a job) or using our services. Learn more about me. I, just like you are, need to support a family.

🙏 Acknowledgments

  • The open-source community for various dependencies