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

docuforge

v1.1.4

Published

Docuforge is a simple and efficient command-line tool (CLI) for automating documentation generation for any software project, regardless of the programming language or technology stack used.

Downloads

95

Readme

Docuforge

Docuforge is a simple and efficient command-line tool (CLI) for automating documentation generation for any software project, regardless of the programming language or technology stack used.

Features

  • Automatic Documentation Generation: Docuforge allows developers to generate up-to-date and accessible documentation directly from the project's code structure.
  • Language Agnostic: The tool is compatible with any programming language, ensuring flexibility and efficiency in any development environment.
  • File/Directory Exclusion: Ability to configure the exclusion of certain files or directories from documentation generation.
  • CLI Execution: Easy-to-use command-line interface for generating documentation with just a few commands.
  • OpenAI Integration: Utilizes the OpenAI API to generate detailed and accurate descriptions of the project's files and directories.
  • Ollama Integration: Supports integration with the Ollama API for generating documentation, providing an alternative to OpenAI.
  • Intelligent Regeneration: Docuforge only regenerates documentation when changes are detected in the code, and it specifically targets only the modified files, saving time and resources.
  • Automatic Deletion of Documentation: Docuforge automatically deletes documentation for files that have been removed from the project, keeping the documentation structure always updated according to the original project.

Project Origin

This project is a fork of codocx, an original documentation generation tool. Docuforge was developed based on this project, expanding its functionalities and adapting it to meet specific needs.

Setting Up Husky (Optional)

To automatically update documentation with each commit, you can set up Husky by following these steps:

  1. Install Husky as a development dependency:

    yarn add -D husky

    Or using npm:

    npm install --save-dev husky
  2. Initialize Husky:

    npx husky-init
  3. Create a script in your package.json called gen-docs:

    {
      "scripts": {
        "gen-docs": "docuforge"
      }
    }
  4. Edit the .husky/pre-commit file to include the following:

    #!/usr/bin/env sh
    . "$(dirname -- "$0")/_/husky.sh"
    
    yarn gen-docs
    
    if [ -n "$(git status docs --porcelain)" ]; then
      git add docs
    fi

This setup will ensure that documentation is generated and updated automatically every time you make a commit.

Overview

Documentation is essential, but often neglected. Docuforge solves this problem by allowing developers to generate up-to-date and accessible documentation with just a few commands. The tool is compatible with any programming language, ensuring flexibility and efficiency in any development environment.

Running via CLI

The Docuforge CLI is designed to be extremely easy to use, allowing documentation generation directly from your project's code structure.

How to Use the CLI

  1. Install the CLI globally:

    npm install -g docuforge

    or

    yarn global add docuforge
  2. Generate the documentation:

    Navigate to your project directory and run:

    docuforge -p <DIR_PROJECT>

    You can replace <DIR_PROJECT> with the path to your project directory. If you don't provide a path, the CLI will use the current directory.

Ignoring Files

To exclude certain files or directories from documentation generation, simply create a .dcfignore file and list the files and folders you want to ignore inside it. The tool will automatically ignore them. Additionally, there is a default list of ignored paths located in the src/constants/index.ts file.

Using Ollama instead of OpenAI

To use the Ollama API for documentation generation instead of OpenAI, you can specify the --ollama-mode option when running the CLI. Additionally, you can set the Ollama base URL and model using the --ollama-base-url and --ai-model options, respectively. Here’s an example command:

docuforge --ollama-mode --ollama-base-url http://localhost:11434/api --ai-model llama3

By default, the Ollama API is used with the llama3 model, and the --ollama-base-url option is set to http://localhost:11434/api. You can change the model by setting the --ai-model option to the desired model, and you can also specify a different base URL if needed.

Requirements

Before you begin, make sure your machine meets the following requirements:

  • Node.js (version 14 or higher)
  • npm (Node.js package manager)

How to Run the Project Manually

If you prefer to run Docuforge locally, follow these steps:

  1. Clone the repository:

    git clone <REPOSITORY_URL>
    cd docuforge
  2. Install dependencies:

    npm install
  3. Start the project:

    npm start

Contributing

Contributions are welcome! If you wish to contribute to Docuforge, follow these steps:

  1. Fork the repository.

  2. Create a branch for your feature or bug fix:

    git checkout -b my-new-feature
  3. Make your changes and commit:

    git commit -m "Add new feature"
  4. Push to the remote repository:

    git push origin my-new-feature
  5. Open a Pull Request.

Please ensure that your contributions comply with the project's code of conduct.

License

This project is licensed under the MIT License. See the LICENSE file for more information.