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

@aigne/typedoc-plugin-example-utils-ts

v1.0.3

Published

A utils library for typedoc to process example codes

Readme

@aigne/typedoc-plugin-example-utils-ts

A utility library for processing TypeDoc example code. This plugin allows you to remove specific function calls from code examples in the @example tags of TypeDoc documentation.

Installation

Using npm:

npm install @aigne/typedoc-plugin-example-utils-ts --save-dev

Using yarn:

yarn add @aigne/typedoc-plugin-example-utils-ts --dev

Using pnpm:

pnpm add @aigne/typedoc-plugin-example-utils-ts -D

Features

This plugin helps you remove specific function calls from code examples in TypeDoc documentation. This is particularly useful in the following scenarios:

  • When your example code contains helper function calls that are only for demonstration purposes
  • When you want to display more concise code examples in your documentation
  • When you need to remove specific debugging or logging functions from examples

Configuration

Add the following options to your TypeDoc configuration file:

{
  "plugin": ["@aigne/typedoc-plugin-example-utils-ts"],
  "removeExpressionsFromExamples": ["spyOn", "expect", "jest.fn"]
}

The removeExpressionsFromExamples option accepts an array of strings specifying the function names to be removed from the example code.

How It Works

The plugin processes all @example tags during TypeDoc's resolveReflection phase. It uses TypeScript's AST (Abstract Syntax Tree) analysis to identify and remove the specified function calls.

Example

Suppose you have the following code with an @example tag:

/**
 * Calculate the sum of two numbers
 *
 * @param a The first number
 * @param b The second number
 * @returns The sum of the two numbers
 *
 * @example
 * ```ts
 * const calculator = ...
 * spyOn(calculator, 'add');
 * const result = calculator.add(1, 2);
 * expect(result).toBe(3);
 * return result;
 * ```
 */
function add(a: number, b: number): number {
  return a + b;
}

If you configure "removeExpressionsFromExamples": ["spyOn", "expect"], the example code in the generated documentation will become:

const calculator = ...
const result = calculator.add(1, 2);
return result;

Development

Clone the repository and install dependencies:

git clone <repository-url>
cd typedoc-plugin-example-utils-ts
pnpm install

Build the project:

pnpm build

License

MIT © Yechao Li