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

lumen-docs

v1.0.12

Published

Generate API documentation from OpenAPI spec files

Downloads

766

Readme

Lumen Docs

Illuminate Your API Documentation Generate, manage, and deploy beautiful API docs from OpenAPI specs using AI magic!

Lumen Docs CLI

To use Lumen Docs, simply run the following command in your terminal:

npx lumen-docs -h

Usage

Usage: lumen-docs [options] [command]

Generate API documentation from OpenAPI spec

Options:
  -V, --version     output the version number
  -h, --help        display help for command

Commands:
  init              Initialize a new Lumen Docs project
  generate          Generate API documentation
  deploy            Deploy API documentation to GitBook
  config            Update Lumen Docs configuration
  enable <service>  Enable GitBook deployment
  help [command]    display help for command

Commands

Initialize

Start your documentation journey with:

npx lumen-docs init

This command sets up a new Lumen Docs project in your current directory. It creates necessary configuration files and folder structure for your API documentation.

Generate

Convert your OpenAPI specs into readable Markdown docs with:

npx lumen-docs generate

Deploy

Share your docs using:

npx lumen-docs deploy 

One command, instant publication.

Development

To run the project in development mode:

  1. Clone the repository:

    git clone https://github.com/emmanuel39hanks/lumen-docs.git
  2. Navigate to the project directory:

    cd lumen-docs
  3. Install dependencies:

    npm install
  4. Build the project:

    npm run build

Configuration

  • The OpenAI API key can be set as an environment variable OPENAI_API_KEY in a .env file.
  • The default location for the OpenAPI spec file is ./spec.json, but you can specify a different location when prompted.

Customization

You can customize the output of the generated documentation by modifying the src/services/markdown.ts file. The generateMarkdownFiles function determines the structure and content of the generated Markdown files.

Error Handling

The tool includes error handling for common issues such as:

  • Invalid API keys
  • File not found errors
  • Parsing errors for the OpenAPI spec

Error messages will be displayed in the console with helpful information for troubleshooting.

Project Structure

lumen-docs/
├── src/
│ ├── cli/
│ │ ├── prompts.ts
│ │ ├── spinner.ts
│ │ └── welcome.ts
│ ├── config/
│ │ └── constants.ts
│ ├── services/
│ │ ├── markdown.ts
│ │ └── openai.ts
│ ├── types/
│ │ ├── index.ts
│ │ └── openapi.ts
│ ├── utils/
│ │ ├── error-handler.ts
│ │ ├── file.ts
│ │ └── openapi-parser.ts
│ └── index.ts
├── .env
├── .gitignore
├── package.json
├── README.md
└── tsconfig.json

Contributing

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

Powered by AI Magic

Lumen Docs leverages OpenAI's GPT model to generate intelligent and context-aware documentation.