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

@fnet/readme

v0.1.33

Published

A simple utility to generate a README.md file from a template and input data

Downloads

285

Readme

@fnet/readme

This project is designed to automate the creation of a README file by analyzing the source code of a project. It leverages OpenAI's language models to generate a README that offers a clear, concise, and honest description of the project's purpose and functionality. The tool aims to save developers time by automating the often time-consuming task of writing documentation, ensuring that it remains straightforward and devoid of any marketing jargon or exaggeration.

How It Works

The project operates through a series of sequential steps that involve reading the project's source code, interacting with OpenAI to generate descriptive content, and then writing this content into a README file. Initially, the tool loads configuration settings and establishes a connection with OpenAI's API. It then retrieves the source code specified by the user, extracts the project title, prepares an AI prompt, and submits this prompt to OpenAI. The response is subsequently processed and saved as a README file, providing an organized view of the project's details and features.

Key Features

  • Automated README Generation: Generates a README based on the project's source code, saving you time and effort.
  • OpenAI Integration: Uses AI models to ensure the README is well-written and informative.
  • Customizable Input: Allows for specific file and title inputs to guide the README creation process.
  • Sequential Process: Executes tasks in a logical order to efficiently produce a comprehensive README.

Conclusion

This project is a useful tool for developers looking to streamline the documentation process. By automating the creation of a README, it helps to ensure that project details are clearly communicated without requiring additional effort. This approach is particularly beneficial for those who want to focus more on coding and less on documentation.

Developer Guide for @fnet/readme

Overview

The @fnet/readme library is designed to automate the process of generating clear and concise README files for your projects. By leveraging the capabilities of OpenAI, this library can analyze your project's source code and generate a README that accurately describes your project's purpose and functionality. Its main features include extracting information from project files, preparing and executing prompts using OpenAI, and writing the generated content to a README file.

Installation

To install @fnet/readme, use either npm or yarn:

npm install @fnet/readme

or

yarn add @fnet/readme

Usage

Using @fnet/readme involves setting up a workflow with your project setup, initiating OpenAI API configurations, and allowing the library to generate and save a README file based on your source code.

Here is a basic usage example:

  1. Initialize the engine with context and file parameters.
  2. Use the run method to start the process.
import ReadmeEngine from '@fnet/readme';

// Initialize engine
const engine = new ReadmeEngine();

// Run the engine with your project specifics
engine.run({
  file: 'path/to/your/source.js', // specify your source file
  title: 'Your Project Title'       // specify a title for your project
}).then(() => {
  console.log('README generation complete.');
}).catch((error) => {
  console.error('Error generating README:', error);
});

Examples

Simple Workflow Execution

This example demonstrates how to set up a simple workflow using @fnet/readme:

import ReadmeEngine from '@fnet/readme';

(async () => {
  try {
    const engine = new ReadmeEngine();
    await engine.run({
      file: 'src/index.js',
      title: 'Sample Project'
    });
    console.log('README generated successfully.');
  } catch (error) {
    console.error('Error:', error);
  }
})();

Handling OpenAI Configuration

The library automatically handles the setup of OpenAI configurations:

import ReadmeEngine from '@fnet/readme';

const engine = new ReadmeEngine();
engine.run({
  file: 'src/index.js',
  title: 'AI Powered README'
}).then(() => {
  console.log('README is ready.');
}).catch((error) => {
  console.error('Failed to generate README:', error);
});

Acknowledgment

This library utilizes OpenAI to generate README content, ensuring the resulting document reflects an honest and straightforward description of the project's main purpose and functionalities.

Input Schema

$schema: https://json-schema.org/draft/2020-12/schema
title: Engine Input Schema
type: object
properties:
  file:
    type: string
    description: File path to be used, fetched from the input parameters.
  title:
    type: string
    description: Title of the fnode, fetched from the input parameters.