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

@brinda_yawa/tasks-generator

v1.0.2

Published

An AI-powered tasks generator using Google GenAI.

Readme

📋 @brinda_yawa/tasks-generator

A powerful Node.js package for automatically generating structured task lists from project titles and descriptions using AI-powered generation with Google's Gemini models.

✨ Features

  • 🤖 AI-Powered Generation - Uses Google's Gemini AI for intelligent task creation
  • 📋 Structured Output - Returns clean, structured JSON task arrays
  • 🎯 Context-Aware - Generates relevant tasks tailored to your project description
  • ⚙️ Configurable - Choose your Gemini model and generation parameters
  • 🔒 Singleton Pattern - Efficient resource management across your application

📦 Installation

npm install @brinda_yawa/tasks-generator

🚀 Quick Start

import TasksGenerator from '@brinda_yawa/tasks-generator';

// Initialize the singleton instance
const generator = TasksGenerator;
generator.init({ apiKey: 'YOUR_API_KEY', model: 'gemini-2.5-flash' });

// Generate tasks from a title and description
const tasks = await generator.generateTasks(
  'Flat Tire',
  'Roadside assistance following a flat tire. Diagnose the affected wheel, check tire condition, repair with plug or replace if necessary, check pressure and balance the wheel.'
);

console.log(tasks);

📖 API Reference

TasksGenerator.init(options)

Initializes the singleton instance with your API credentials.

Parameters:

  • options.apiKey (string, required) — Your Google Gemini API key
  • options.model (string, optional) — The Gemini model to use. Default: 'gemini-2.5-flash'

Example:

import TasksGenerator from '@brinda_yawa/tasks-generator';

const generator = TasksGenerator;
generator.init({
  apiKey: process.env.GEMINI_API_KEY,
  model: 'gemini-2.5-flash'
});

generator.generateTasks(title, description)

Generates a structured list of tasks from a title and description.

Parameters:

  • title (string, required) — The title of the project or intervention
  • description (string, required) — A detailed description of what needs to be done

Returns: Promise<Array<Object>> — An array of structured task objects

Example:

const tasks = await generator.generateTasks(
  'Flat Tire',
  'Roadside assistance following a flat tire. Diagnose the affected wheel, check tire condition, repair with plug or replace if necessary, check pressure and balance the wheel.'
);

// Returns:
[
  {
    "title": "Diagnose affected wheel",
    "description": "Inspect the flat tire to identify the cause of deflation",
    "priority": "high"
  },
  {
    "title": "Assess tire condition",
    "description": "Determine whether the tire can be repaired or needs replacing",
    "priority": "high"
  },
  {
    "title": "Repair or replace tire",
    "description": "Apply plug repair or mount a replacement tire as needed",
    "priority": "high"
  },
  {
    "title": "Check pressure and balance",
    "description": "Verify correct inflation pressure and wheel balance after intervention",
    "priority": "medium"
  }
  // ... more tasks
]

🌍 Environment Variables

Create a .env file at the root of your project:

GEMINI_API_KEY=your_api_key_here

Recommendation: Use gemini-2.5-flash for both development and production for the best speed/quality balance.


💡 Advanced Usage

Handling Multiple Projects

import TasksGenerator from '@brinda_yawa/tasks-generator';
import dotenv from 'dotenv';

dotenv.config();

const generator = TasksGenerator;
generator.init({ apiKey: process.env.GEMINI_API_KEY });

const projects = [
  {
    title: 'Flat Tire',
    description: 'Roadside assistance for a flat tire. Inspect, repair or replace, and verify pressure.'
  },
  {
    title: 'Battery Replacement',
    description: 'Replace a dead car battery. Diagnose charge level, disconnect old battery, install new one, test electrical system.'
  }
];

async function generateAllTasks(projects) {
  const results = [];

  for (const project of projects) {
    const tasks = await generator.generateTasks(project.title, project.description);
    if (tasks) {
      results.push({ project: project.title, tasks });
    }
  }

  return results;
}

const allTasks = await generateAllTasks(projects);
console.log(`Generated tasks for ${allTasks.length} projects`);

Error Handling

import TasksGenerator from '@brinda_yawa/tasks-generator';

const generator = TasksGenerator;
generator.init({ apiKey: process.env.GEMINI_API_KEY });

try {
  const tasks = await generator.generateTasks(
    'Oil Change',
    'Standard vehicle oil change: drain old oil, replace filter, fill with new oil, check levels.'
  );

  if (!tasks || tasks.length === 0) {
    console.error('No tasks were generated.');
  } else {
    console.log('Tasks generated successfully:', tasks);
  }
} catch (error) {
  if (error.message.includes('quota')) {
    console.error('API quota exceeded. Please wait or upgrade your plan.');
  } else if (error.message.includes('API key')) {
    console.error('Invalid API key. Please check your credentials.');
  } else if (error.message.includes('obligatoires')) {
    console.error('Title and description are required fields.');
  } else {
    console.error('Generation error:', error.message);
  }
}

Using with Express.js

import express from 'express';
import TasksGenerator from '@brinda_yawa/tasks-generator';

const app = express();
app.use(express.json());

const generator = TasksGenerator;
generator.init({ apiKey: process.env.GEMINI_API_KEY });

app.post('/generate-tasks', async (req, res) => {
  try {
    const { title, description } = req.body;

    if (!title || !description) {
      return res.status(400).json({ error: 'Title and description are required.' });
    }

    const tasks = await generator.generateTasks(title, description);

    if (!tasks) {
      return res.status(500).json({ error: 'Task generation failed.' });
    }

    res.json({ success: true, tasks });
  } catch (error) {
    res.status(500).json({ error: error.message });
  }
});

app.listen(3000, () => console.log('Server running on port 3000'));