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

@tanstack-dev/translate-docs

v1.16.0

Published

Translate tanstack-dev documentation

Readme

@tanstack-dev/translate-docs

A utility for translating TanStack documentation into multiple languages.

Configuration

Create a translate.config.mjs file in your project root with the following structure:

// Single configuration
export default {
  langs: {
    // Language configurations
    // Example: 'zh', 'es', 'fr', etc.
    [languageCode]: {
      name: String,         // Language name
      guide: String,        // Translation guidelines
      terms: {              // Dictionary of common terms
        // 'term': 'translation'
      },
    },
  },
  docsRoot: String | String[],  // Root directory or array of root directories
  docsContext: String,          // Context information for the translator
  pattern: String,              // Optional: File pattern to match (same as --pattern)
}

// OR multiple configurations as an array
export default [
  {
    langs: { /* ... */ },
    docsRoot: String | String[],
    docsContext: String,
    pattern: String,        // Optional
  },
  // ...more configurations
]

A sample configuration file (translation.config.example.mjs) is included in the repository that demonstrates how to set up translations for multiple languages including Simplified Chinese, Traditional Chinese, Japanese, Spanish, German, French, Russian, and Arabic. You can use this as a starting point for your own translations.

Usage

Run the translation tool with:

OPENAI_API_KEY=your-openai-api-key npx translate-docs

Command Line Options

The tool supports the following command line options:

Options:
  -c, --config <path>      Path to configuration file
  --verbose            Enable verbose logging
  -p, --pattern <pattern>  File pattern to match for updating (e.g., "*.md" or "**/*.tsx")
  -y, --copy-path <pattern> File pattern to copy without translation (e.g., "reference/**")
  -d, --docs-path <pattern> File pattern for docs to translate (e.g., "**/*.md")
  -l, --list-only          Only list file status without updating docs
  -t, --target-language <language> Specify target language code for translation
  -h, --help               Display help for command
  -v, --version            Show version number

Examples:

# Use a specific configuration file
npx translate-docs --config ./custom-config.mjs

# Only process markdown files
npx translate-docs --pattern "**/*.md"

# Copy specific directories without translation
npx translate-docs --copy-path "reference/**"

# Just check which files would be processed without making changes
npx translate-docs --list-only

# Enable verbose logging for troubleshooting
npx translate-docs --verbose

# Translate only to a specific language
npx translate-docs --target-language "zh-CN"

GitHub Actions Integration

You can automate translations using GitHub Actions. The TanStack Dev team provides an official GitHub Action for this purpose.

For more information and usage examples, refer to: https://github.com/TanStack-dev/translate-docs-action

Configuration vs Command Line Options

You can specify file selection options (pattern, copy-path, docs-path) either in the configuration file or as command line arguments:

  • Configuration file approach: Add pattern fields directly in your configuration file for persistent settings:

    export default {
      langs: { /* ... */ },
      docsRoot: 'docs',
      docsContext: 'Your context here',
      pattern: '**/*.md',
      copyPath: 'reference/**,framework/*/reference/**'
    }
  • Command line approach: Use CLI flags for one-time executions or to override configuration file settings:

    npx translate-docs --pattern "**/*.md" --copy-path "reference/**,framework/*/reference/**"

Command line options take precedence over configuration file settings when both are specified.