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

autoscribe

v1.0.1

Published

Auto-generate meaningful JSDoc comments and function documentation.

Readme

AutoScribe Documentation Generator

AutoScribe is an AI-powered documentation generator that automatically creates comprehensive JSDoc/TSDoc comments for your JavaScript and TypeScript code using GPT 4.o.

Features

  • Generates rich file-level and function-level documentation
  • Processes individual files or entire directories recursively
  • Supports JavaScript (.js), TypeScript (.ts), JSX (.jsx), and TSX (.tsx) files
  • Maintains existing code structure while adding documentation
  • Configurable through environment variables or command-line arguments
  • Supports "dry-run" mode which outputs in terminal
  • Handles various function types including:
    • Function declarations
    • Arrow functions
    • Class methods
    • Object methods

Prerequisites

  • Node.js (version 14 or higher recommended)
  • OpenAI API key
  • NPM or Yarn package manager

Installation

  1. Clone the repository:
git clone [https://github.com/adamchain/autoscribe.git]
cd [autoscribe]
  1. Install dependencies:
npm install
  1. Create a .env file in the project root:
OPENAI_API_KEY=your_api_key_here
OPENAI_MODEL=gpt-4o
OUTPUT_FORMAT=jsdoc
SUPPORTED_EXTENSIONS=.js,.jsx,.ts,.tsx
MAX_RETRIES=3
DRY_RUN=false

Usage

Basic Usage

node autoscribe.js <path> --api-key <your-api-key>

Command Line Options

  • --dry-run: Generate documentation in terminal, without modifying files
  • --api-key <key>: OpenAI API key (not required if key is in env)
  • --recursive: Process directories recursively
  • --model <model>: OpenAI model to use (default: gpt-4o)
  • --format <format>: Documentation format (jsdoc|tsdoc)

Examples

Document a single file:

node autoscribe.js ./src/component.js

Document an entire directory recursively:

node autoscribe.js ./src --recursive

Preview documentation without making changes:

node autoscribe.js ./src/component.js --dry-run

Configuration

The tool can be configured through environment variables or command-line arguments:

| Environment Variable | Description | Default | |---------------------|-------------|---------| | OPENAI_API_KEY | Your OpenAI API key | Required | | OPENAI_MODEL | GPT model to use | gpt-4o | | OUTPUT_FORMAT | Documentation format | jsdoc | | SUPPORTED_EXTENSIONS | File extensions to process | .js,.jsx,.ts,.tsx | | MAX_RETRIES | Maximum retry attempts | 3 | | DRY_RUN | Preview mode | false |

Generated Documentation Format

The tool generates comprehensive documentation including:

File-Level Documentation

  • File purpose
  • Main components/functions
  • Important notes and dependencies

Function-Level Documentation

  • Function description
  • Parameter types and descriptions
  • Return value type and description
  • Exception documentation when applicable

Error Handling

  • Retries failed API calls up to the configured maximum
  • Validates generated documentation format
  • Provides detailed error messages for troubleshooting
  • Maintains original code if documentation generation fails

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

GPL-3.0 license

Acknowledgments

  • OpenAI for the brain
  • Babel for AST parsing

Support

For issues, questions, or contributions, please create an issue in the repository.