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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@zamiell/typedoc-plugin-not-exported

v0.2.0

Published

TypeDoc plugin that forces inclusion of non-exported symbols (variables)

Downloads

1,117

Readme

typedoc-plugin-not-exported

npm package version number Actions Status License

This TypeDoc plugin can force inclusion of specific symbols (variables) that are not exported, by making them fake exports.

Usage

(Assuming you have already installed TypeDoc (npm i -D typedoc) of version equal to or greater than v0.20.16 (released on 2021-01-17, this is the minimum required by this plugin. If you need to update the version, change TypeDoc's version number in package.json and rerun npm i / yarn))

Install the plugin with npm:

npm i -D typedoc-plugin-not-exported

Or with yarn:

yarn add -D typedoc-plugin-not-exported

In your code, tag the symbols (i.e. variables / types / interfaces / classes / object properties / class members etc.) that are not exported but you still want to include in the generated documentation.

The default tag is @notExported.

Example 1:

/**
 * My class
 * @notExported
 */
class MyClass {
  convert(str: string): string {
    return str
  }
}
export const me = new MyClass()

Example 2:

/**
 * @notExported
 */
type twoNumbers = [number, number]
/**
 * @notExported
 */
type threeNumbers = [number, number, number]

export type twoOrThreeNumbers = twoNumbers | threeNumbers
export function sum(ns: twoOrThreeNumbers): number {
  return ns.reduce((a, b) => a + b)
}

Then use the command as usual:

typedoc src/index.ts

Or, if you are using @internalDoNotUse tag instead of @notExported, run:

typedoc --includeTag internalDoNotUse src/index.ts

Links, Tips & Others

Originally from here.

CC0.

TypeDoc converts comments in TypeScript source code into rendered HTML documentation. See Guides, API & repo.

TypeDoc loads all plugins by default, if you want to specify plugins to load, use --plugin flag.

Those non-exported symbols (variables) you want to include in the doc, are not public and the @public tag shouldn't be applied. TypeDoc's @internal tag and typedoc-plugin-internal-external's @internal and @external are not made to solve the problem in question.

Nevertheless, if you want to include a symbol (variable) in the documentation, you should usually export it.

Keywords: typedoc plugin force include non exported unexported variable symbol member fake export option flag tag mode file exclude inclusion internal external