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

typedoc-plugin-language-switcher

v1.0.2

Published

Adds the ability to provide multiple selectable languages in code blocks.

Readme

typedoc-plugin-language-switcher

Implements a language switcher feature into TypeDoc pages, allowing your documentation to be switched between different language modes. Multi-language code blocks will only show the code for the language the user specifies, which can be toggled at any time.

Configuration

Install the package, and add it to your typedoc.json:

{
    "plugin": [
        "typedoc-plugin-language-switcher"
    ],
    "languages": []
}

A new configuration option called languages is added, which is an array of strings specifying the language modes for your site. This must contain the exact language IDs you use for code blocks, in the order that they will be listed in the docs. For example, for a site with TypeScript and JavaScript modes, set this to ["ts", "js"], and use ```ts and ```js code blocks. Note that this will not match aliases as well, so the aforementioned setting would not match ```typescript blocks. The first language in the list will be the default selection.

Usage

To make a multi-language code block, simply write ``` code blocks for each language, in the order listed in languages. No further configuration is required! For example:

/**
 * This is a test of multiple languages.
 * 
 * ```ts
 * function MyFunction(param: string): number {
 *    return param as number;
 * }
 * ```
 * ```js
 * /// @param {string} param
 * /// @returns {number}
 * function MyFunction(param) {
 *    return param;
 * }
 * ```
 */

TypeScript
JavaScript

Any text between each code block will suppress making it multi-language, such as  . Blocks that are not in this format, or are in other languages, will display as normal. Be aware that the styling system currently only chains pairs of blocks, so if you have more than two languages, consecutive blocks of any two registered languages in order will also be treated as multi-language despite not having all of the registered languages.

The selected language can be changed in the settings dropdown in the sidebar. This setting will be saved in local storage, so it persists across pages. (Note: Local storage use here is not controlled by the TypeDoc.disableLocalStorage API! This is due to it being impossible to fetch the underlying state from the API.) To improve readability, the name of the language for every highlighted code block is added in a header above the code block.