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 🙏

© 2025 – Pkg Stats / Ryan Hefner

contentbot

v1.1.6

Published

A Node.js module that generates blog content using Groq SDK

Downloads

757

Readme

ContentBot

A Node.js module that generates blog content and topic ideas using Groq AI, with the ability to incorporate current news articles and research from multiple sources.

Features

  • Generate comprehensive, engaging blog posts on any topic
  • Generate topic ideas with SEO-friendly titles and summaries
  • Automatically fetch and incorporate relevant news articles from multiple sources:
    • Bing News
    • Tavily Search API
  • Optional enhanced research mode that can include:
    • Reddit posts and discussions
    • YouTube videos
  • Format output in Markdown with proper headings, lists, and emphasis
  • Customize the AI model used for generation
  • Save all generated content to the output directory

Installation

Global Installation

npm install -g contentbot

Local Installation

npm install contentbot

Usage

CLI Usage

If installed globally:

# Generate a blog post
contentbot create-blog --topic "Your Topic Here"

# Generate topic ideas
contentbot generate-topics --category "Your Category" --count 3

If installed locally:

# Generate a blog post
npx contentbot create-blog --topic "Your Topic Here"

# Generate topic ideas
npx contentbot generate-topics --category "Your Category" --count 3

Simple Programmatic Usage

const ContentBot = require('contentbot');

// Create a new ContentBot instance
const contentBot = new ContentBot();

// Generate topic ideas
async function generateTopics() {
  try {
    const result = await contentBot.generateTopics('Digital Marketing', {
      count: 3,
      audience: 'business owners',
      outputPath: './output/topics.json',
      researchMode: 'basic'  // Use 'enhanced' for Reddit/YouTube research
    });

    console.log('Generated Topics:', result.topics);
  } catch (error) {
    console.error('Error:', error.message);
  }
}

// Generate a blog post
async function generateBlog() {
  try {
    const result = await contentBot.createBlog('Artificial Intelligence Ethics', {
      outputPath: './output/ai-ethics.md',
    });

    console.log(`Blog post written to: ${result.filePath}`);
    console.log(`Content: ${result.content}`);
  } catch (error) {
    console.error('Error:', error.message);
  }
}

Advanced Usage

The package includes example files demonstrating both simple and advanced usage:

const ContentBot = require('contentbot');

// Create a new ContentBot instance with custom configuration
const contentBot = new ContentBot({
  model: 'llama3-70b-8192',
});

// Generate topics with all available options
const result = await contentBot.generateTopics('Digital Marketing', {
  count: 3,
  audience: 'business owners',
  outputPath: './output/topics.json',
  model: 'llama3-70b-8192',
  keywords: ['SEO', 'content strategy'],
  bingCount: 5,
  tavilyCount: 5,
  researchMode: 'enhanced'  // Includes Reddit and YouTube research
});

Check out the example files in the examples directory for more detailed usage:

  • generate-topics-simple.js - Basic topic generation
  • generate-topics-example.js - Advanced usage with all options

CLI Options

Generate Topics Command

contentbot generate-topics --category "Your Category" [options]

Options:

  • --category, -c: Category for topic generation (required)
  • --count, -n: Number of topics to generate (default: 5)
  • --output, -o: Output file path (default: ./output/topic-ideas.json)
  • --model, -m: Groq model to use (default: llama3-70b-8192)
  • --audience, -a: Target audience (default: "general")
  • --keywords, -k: Keywords to include (comma-separated)
  • --bing, -b: Number of Bing news articles to fetch (default: 3)
  • --tavily: Number of Tavily search results to fetch (default: 3)

Create Blog Command

contentbot create-blog --topic "Your Topic" [options]

Options:

  • --topic, -t: Topic for the blog post (required)
  • --output, -o: Output file path (default: ./output/blog-post.md)
  • --model, -m: Groq model to use (default: llama3-70b-8192)
  • --help, -h: Show help

Requirements

  • Node.js 14 or higher
  • A Groq API key
  • (Optional) A Tavily API key for enhanced search results

Environment Variables

Create a .env file with your API keys:

GROQ_API_KEY=your_groq_api_key_here
TAVILY_API_KEY=your_tavily_api_key_here  # Optional

Get your API keys:

License

MIT