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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@alphanull/jsdoc-plugin-esnext

v1.3.0

Published

JSDoc plugin that adds full ES2022+ class-feature support – private fields, static members, arrow-bound methods, and ES6 default export fixes.

Readme

License Version

JSDoc ESNext Plugin

JSDoc plugin that adds full ES2022+ class-feature support – private fields, static members, arrow-bound methods, as well as ES6 default export fixes.

Modern JavaScript syntax isn’t always accurately recognized by JSDoc. This plugin enables accurate recognition of modern ECMAScript class structures and enhances the resulting documentation.

Features

  • Restores accurate naming for native #privateFields and #methods().
  • Automatically tags private members with @private.
  • Detects static class members and applies @static and scope: static.
  • Treats arrow-bound methods as @function.
  • Detects assignments like this.#foo = ... in constructors.
  • Fixes various ES6 default export issues - corrects wrong names and structures for exported classes, functions, object literals, and their members.
  • Static class properties are correctly parsed with static scope instead of instance scope.
  • ES6 class mixin static members retain their static scope during augmentation.
  • Prevents duplicated mixin fields when classes declare constructors.
  • Works seamlessly with JSDoc's default parser.
  • Works with all themes (but see note below!).
  • Perfectly integrates with VisionTheme for a modern UI (optional).
  • Tested with JSDoc 3.6.11 and 4.0.4.

Installation

npm install --save-dev @alphanull/jsdoc-plugin-esnext

Then, add the plugin to your JSDoc configuration file:

{
    "plugins": [
        "@alphanull/jsdoc-plugin-esnext"
    ]
}

ES2022 Example

export default class Example {

    /**
     * Static counter
     * @type {number}
     */
    static counter = 0;

    /**
     * Private field
     * @type {string}
     */
    static #secret = 'abc';

    /**
     * Bound handler
     * @function
     */
    #handleClick = () => {
        console.log('clicked');
    }

    constructor() {
        this.#local = 123;
    }

    /**
     * Private method
     */
    #compute() {
        return true;
    }
}

Resulting Documentation

| before | after | | :----------------------------------------------------------: | :----------------------------------------------------------: | | Without plugin | Using jsdoc-plugin-esnext |

  • counter appears with @static and type.
  • #secret is listed as private static.
  • #handleClick is listed as a private function.
  • #compute() is listed as a private method.

Exports Example

/**
 * Exported as default class.
 */
export default class FooClass {
    /**
     * FooClass constructor.
     * @param {string} message - Additional message.
     */
    constructor(message) { }
    /**
     * This is a class method.
     * @param {any} someArg - An arg you need to pass.
     */
    classMethod(someArg) {
    this.fooAClassMethod(this.message);
    }
}

Resulting Documentation

| before | after | | :----------------------------------------------------------: | :----------------------------------------------------------: | | Without plugin | Using jsdoc-plugin-esnext |

  • FooClass is named correctly (not exports).
  • Class members (constructor, properties, methods) are correctly linked to their parent class and do not appear in Global.

Static Properties & Mixins Example

/**
 * ES6 class mixin with static members.
 * @mixin TestMixin
 */
class TestMixin {
  /**
   * Static property - correctly parsed as static scope.
   * @type {string}
   */
  static staticProp = 'static';

  /**
   * Static method - correctly retains static scope during augmentation.
   * @returns {string}
   */
  static staticMethod() {
    return 'static';
  }
}

/**
 * Class using the mixin.
 * @class TestClass
 * @mixes TestMixin
 */
class TestClass extends TestMixin {
  /**
   * Class static property - correctly parsed as static scope.
   * @type {string}
   */
  static classStaticProp = 'classStatic';
}

Resulting Documentation

| before | after | | :----------------------------------------------------------: | :----------------------------------------------------------: | | Without plugin | Using jsdoc-plugin-esnext |

  • TestClass.staticProp appears with @static and scope static (fixes JSDoc Bug #2144).
  • TestClass.staticMethod retains static scope during mixin augmentation (fixes JSDoc Bug #2146).
  • TestClass.classStaticProp is correctly parsed as static scope.

Tests

Run the integration suite to ensure all plugin features keep working:

npm test

Snapshots land in the destination chosen in test/jsdoc.config.json (default test/output/) for manual inspection.

Limitations

While there are no limitations with this plugin per se, for private members (which start with "#") there can be resulting hash links containing two hashes, like: <a href="##privateMember">#privateMember</a> which can lead to broken links. Unfortunately, this cannot be handled by the plugin itself and needs to be managed by the theme.

The good news is that documenting modern code typically requires a modern theme anyway. Consider using the brand-new JSDoc VisionTheme, which addresses this issue and is fully tested and optimized for compatibility with this plugin.

License

MIT License

Copyright © 2025–present Frank Kudermann @ alphanull.de