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

lua-doc-extractor

v3.3.2

Published

Extracts lua documentation from C-style comments

Readme

lua-doc-extractor

standard-readme compliant

Extracts lua documentation from C-style comments.

Install

$ npm install -g lua-doc-extractor

Usage

Example

Input

/***
 * Main API
 * @table Api
 * @field Version integer
 */

/***
 * The absolute path to the executable.
 * @global ExecutablePath string
 */

/***
 * @enum NameType
 * @field FirstName 1 First name.
 * @field LastName 2 Last name.
 */

/***
 * @field NameType.FullName 3 Full name, including middle names.
 */

/***
 * Get name by ID
 * @function Api.GetName
 * @param id integer The integer of the person.
 * @param nameType NameType Which name to return.
 * @return string name The full or first name of the person.
 */
int SomeClass::GetName(lua_State *L)
{

Output

---@meta

---Main API
Api = {
	---@type integer
	Version = nil
}

---The absolute path to the executable.
---@type string
ExectablePath = nil

---@enum NameType
NameType = {
	--- First name.
	FirstName = 1,

	---Last name.
	LastName = 2,

	---Full name, including middle names.
	FullName = 3
}

---Get name by ID
---
---@param id integer The integer of the person.
---@param nameType NameType Which name to return.
---@return string name The full or first name of the person.
function Api.GetName(id, nameType) end

CLI

Process files:

$ lua-doc-extractor some-file.cpp other-files/*.cpp --dest output

Show usage:

$ lua-doc-extractor --help

To add GitHub source links to the exported library. Provide the --repo argument.

$ lua-doc-extractor **/*.cpp --dest library --repo https://github.com/beyond-all-reason/spring/blob/62ee0b4/

Comments

Lua docs in document comment blocks (/*** <docs> */) will be parsed.

Annotations

All lua language server annotations can be used, some with special handling. Some additional annotations are required by lua-doc-extractor.

@global

@global <name> <type> [description]

Defines a global variable.

@field

@field <name> <type> [description]

Add fields to a table (@table, @class or @enum) by including them in the same comment.

@field <table>.<name> <type> [description]

You can also add fields to a table defined in a different comment.

@function

@function <name> [description]

Defines a global function.

@function <table>.<name> [description]
@function <table>:<name> [description]

Adds a function to a @table or @class defined in a different comment.

Should be paired with @param, @return and @generic attributes.

@table

@table <name>

Defines a global table. Fields can be added with @field.

@enum

@enum <name>

Defines a global table marked with the @enum attribute. Entries can be added with @field.

@class

@class <name>

Defines a class. Fields can be added with @field, methods can be added with @function.

Contributing

PRs accepted.

License

MIT