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

featuredoc

v0.0.6

Published

As-built functional docs generator

Readme

FeatureDoc

As-built functional docs generator

About

This program is a tool that analyzes a source code repository and automatically generates ‘functional’ documentation from source code comments — not technical API-level documentation like e.g. JSDoc, but docs that are meant to be used by your non-developer coworkers to understand the as-built features that are provided by the software.

In a nutshell, FeatureDoc traverses all files in the repository, and extracts documentation in Markdown format (from lines that include a specific prefix). The resulting Markdown text is written to a file, so that it can be converted to HTML or PDF for distribution.

The order in which text is copied to the output file is determined automatically, or manually using imports and references.

Usage

FeatureDoc outputs the generated Markdown file to the standard output stream, processing all files within the current folder (i.e. .).

npm i -D featuredoc
featuredoc

Syntax

Prefix FeatureDoc lines within your source code with // @@ or ## @@ to include them in the generated output. Additional whitespace in front of the comment tag is allowed. The space between the start of the comment and @@ is optional (i.e. //@@ is also valid).

// @@ This is a documentation line
// @@ > Add _any_ kind of Markdown formatting here.

An extra newline is added automatically after all non-contiguous documentation lines, except between lines that are part of an ordered or unordered list, or a table (i.e. starting with -, *, or 1., 2. and so on, or a line starting with |).

Entire files — To include the entire contents of a file, include the following line anywhere inside your file (e.g. within a comment). Whitespace in front of this line is allowed.

##@@ FeatureDoc @@##

HTML and JSX — to include FeatureDoc lines within other types of text files, you may include them inside of a multi-line comment so that the line appears on its own.

{/*
    ##@@ Documentation within JSX
*/}

Next-line appends — if a line ends with a \ character, the next line is appended to the current line as part of the documentation line. This is useful for including existing source code documentation (e.g. JSDoc) in your output. Any comment syntax on the next line is removed, including starting and ending comment characters (i.e. /*, */, //, etc.).

// @@ - Property: `name` --\
/** The customer name */
name: string;

This results in the following output:

- Property: `name` -- The customer name

Imports — you can directly import the content of one file inside another. The prefixed content of the imported file is then no longer included in the output on its own.

// @@ +import ./some-file.js
// @@ +import ./some-other-file.js

References — you can also add a file directly to the list of references. The referenced files are traversed before all other files.

// @@ +ref ./some-file.js

File traversal and sorting

All files in the current directory are traversed hierarchically and alphabetically, breadth-first. However, if a .gitignore file and/or .docignore file is found, matching files and directories are not traversed. A heuristic is used to exclude binary files as well (e.g. image files).

Before traversing files in a particular directory alphabetically, any files with names starting with index. or main. are processed first. Therefore, manually ordering files is possible by including a file such as index.doc.txt that references other files.

Architecture

The source code contains the following main modules:

  • index.js — Reads all files in the current directory (and subdirectories) and processes them; uses glob to list all files while excluding .gitignore-d files and similarly ignored patterns from a .docignore file.
  • process.js — Loads and processes one file at a time
  • parse.js — Parses the contents of a single file, recurses into process.js if needed
  • collate.js — Collates the output and returns the final result
  • istext.js — Provides a single heuristic function to determine if a file should be processed (i.e. no control characters with a byte value below 32, other than \r, \n, and \t, and a file extension other than some known binary formats that are often included in source code repositories).

License

This program is open source, and released under the MIT license.