1.0.0 • Published 9 months ago

ai-todo v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
9 months ago

AI TODO Generator

A powerful tool for automatically generating TODO comments in your JavaScript and Python code files. Leveraging the capabilities of the Polyfact AI model, this tool scans through your code, recognizes areas for improvement, and inserts insightful TODO comments at the top of your files.

Table of Contents

Features

  • Automatic TODO Generation: Analyzes the code to suggest improvements or corrections.
  • Support for JavaScript & Python: Works with both .js and .py files.
  • Hash-Based Tracking: Utilizes SHA-256 hashing to track changes and avoid redundant analysis.
  • Integration with Polyfact: Uses advanced AI models from the Polyfact package.

Installation

Install the package locally in your project:

npm install ai-todo

Or globally for system-wide access:

npm install -g ai-todo

Quick Run

For a quick run, you can use the following command:

npx ai-todo <directory>

Replace <directory> with the path to the directory containing your code files.

Usage

Processing a Single File

To process a single file, you can use the processFile function:

import { processFile } from 'ai-todo';

const filePath = './path/to/yourfile.js';
const TODOsPath = './path/to/TODOS.md';

processFile(filePath, TODOsPath);

Processing a Directory

To process an entire directory, use the processDirectory function:

import { processDirectory } from 'ai-todo';

const dir = './path/to/your/directory';
const TODOsPath = './path/to/TODOS.md';

processDirectory(dir, TODOsPath);

Customization

You can also customize the TODO generation by adding a norm in the TODOS.md file at the root directory:

norm=YourCustomNorm

This norm will be used as a context when generating TODO comments.

Contribution

If you have ideas for more functionalities or found a bug, please open an issue or send a pull request.


Made with :heart: by Gautam.

Powered by Polyfact.