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

@bernierllc/ai-content-generator

v1.0.6

Published

AI-powered content generation service for social posts, blog articles, emails, and multi-platform content

Downloads

388

Readme

@bernierllc/ai-content-generator

AI-powered content generation service for social posts, blog articles, emails, and multi-platform content from source material.

Installation

npm install @bernierllc/ai-content-generator

Features

  • Social Media Generation: Create platform-optimized posts for Twitter, LinkedIn, Facebook, Instagram, Mastodon, and Bluesky
  • Blog Generation: Generate full blog posts from outlines with SEO optimization
  • Email Generation: Create compelling emails with subject lines and preheaders
  • Multi-Platform: Generate content for multiple platforms from a single source
  • Thread Generation: Create Twitter/LinkedIn threads from long-form content
  • Hashtag Generation: Generate relevant hashtags for any content
  • Commit-to-Content: Transform git commits into blog posts, social posts, or emails
  • Batch Generation: Process multiple generation requests in parallel
  • Analytics: Track generation statistics and usage

Usage

Basic Setup

import { AIContentGenerator } from '@bernierllc/ai-content-generator';
import { OpenAIProvider } from '@bernierllc/ai-provider-openai';

const provider = new OpenAIProvider({
  providerName: 'openai',
  apiKey: process.env.OPENAI_API_KEY!,
});

const generator = new AIContentGenerator({
  provider,
  enableAnalytics: true,
});

Generate Social Media Post

const twitterPost = await generator.generateSocialPost(
  'Excited to announce our new TypeScript features that improve developer productivity by 50%!',
  'twitter',
  {
    includeHashtags: true,
    hashtagCount: 3,
    includeEmojis: true,
    callToAction: true,
  }
);

console.log(twitterPost.content);
// "🚀 Big news! Our new TypeScript features boost dev productivity by 50%!
//  Check it out and level up your coding game! #TypeScript #DevTools #Productivity"

Generate Multi-Platform Content

const multiPlatform = await generator.generateMultiPlatformContent(
  'Blog post about AI-powered development tools and their impact on software engineering',
  ['twitter', 'linkedin', 'facebook', 'instagram'],
  {
    tone: 'professional',
    targetAudience: 'software developers',
  }
);

multiPlatform.results.forEach(({ platform, result }) => {
  console.log(`\n${platform.toUpperCase()}:`);
  console.log(result.content);
});

Generate Blog Post

const blogPost = await generator.generateBlogPost(
  {
    topic: 'Getting Started with TypeScript Generics',
    sections: [
      {
        title: 'What are Generics?',
        keyPoints: ['Type parameters', 'Reusability', 'Type safety'],
      },
      {
        title: 'Basic Examples',
        keyPoints: ['Generic functions', 'Generic interfaces', 'Generic classes'],
      },
      {
        title: 'Advanced Patterns',
        keyPoints: ['Constraints', 'Default types', 'Conditional types'],
      },
    ],
    targetAudience: 'intermediate developers',
    tone: 'educational',
  },
  {
    targetLength: 1500,
    includeIntro: true,
    includeConclusion: true,
    seoKeywords: ['TypeScript', 'Generics', 'Type Safety'],
  }
);

console.log(blogPost.content);
console.log(`Word count: ${blogPost.metadata?.wordCount}`);

Generate Email

const email = await generator.generateEmail(
  'Announcing our new product features including real-time collaboration and AI-powered suggestions',
  'newsletter',
  {
    includeCallToAction: true,
    targetAudience: 'existing customers',
    tone: 'friendly and professional',
  }
);

console.log('Subject:', email.metadata?.subject);
console.log('Preheader:', email.metadata?.preheader);
console.log('Body:', email.content);

Generate Thread

const thread = await generator.generateThread(
  'Long-form content about TypeScript best practices and common pitfalls...',
  'twitter',
  10 // max posts
);

thread.posts.forEach((post, i) => {
  console.log(`\nTweet ${i + 1}/${thread.totalPosts}:`);
  console.log(post);
});

Generate from Git Commit

const commitContent = await generator.generateFromCommit(
  {
    sha: 'abc123',
    message: 'feat(auth): Add JWT token validation with refresh token support',
    author: 'John Doe',
    files: ['src/auth.ts', 'src/middleware/jwt.ts', 'src/types/auth.ts'],
    additions: 145,
    deletions: 23,
  },
  ['blog', 'social', 'email']
);

console.log('Blog:', commitContent.generatedContent.blog?.content);
console.log('Social:', commitContent.generatedContent.social?.content);
console.log('Email:', commitContent.generatedContent.email?.content);

Generate Hashtags

const hashtags = await generator.generateHashtags(
  'New AI-powered development tools that revolutionize coding',
  5,
  true // trending
);

console.log('Hashtags:', hashtags.hashtags.join(', '));
// Output: "AI, DevTools, Coding, TechNews, Innovation"

Batch Generation

const batchResults = await generator.batchGenerate([
  {
    id: 'tweet-1',
    type: 'social',
    sourceContent: 'Product launch announcement',
    platform: 'twitter',
    options: { includeHashtags: true },
  },
  {
    id: 'linkedin-1',
    type: 'social',
    sourceContent: 'Product launch announcement',
    platform: 'linkedin',
    options: { tone: 'professional' },
  },
  {
    id: 'email-1',
    type: 'email',
    sourceContent: 'Product launch details',
    emailType: 'announcement',
    emailOptions: { includeCallToAction: true },
  },
]);

console.log(`Generated: ${batchResults.successCount}/${batchResults.totalGenerated}`);

Analytics

const analytics = generator.getAnalytics({
  start: new Date('2025-01-01'),
  end: new Date(),
});

console.log(`Total generations: ${analytics.totalGenerations}`);
console.log(`By platform:`, analytics.byPlatform);
console.log(`Average tokens: ${analytics.averageTokens}`);
console.log(`Estimated cost: $${analytics.totalCost.toFixed(4)}`);

API Reference

AIContentGeneratorConfig

| Property | Type | Description | |----------|------|-------------| | provider | AIProvider | AI provider instance for generation | | fallbackProvider | AIProvider | Optional fallback provider | | defaultOptions | GenerationOptions | Default options for all generations | | enableAnalytics | boolean | Enable analytics tracking | | maxRetries | number | Maximum retries for failed generations | | defaultTemperature | number | Default temperature (0-1) |

GenerationOptions

| Property | Type | Description | |----------|------|-------------| | creativity | number | Creativity level (0-1) | | targetAudience | string | Target audience description | | tone | string | Desired content tone | | includeHashtags | boolean | Include hashtags in social content | | hashtagCount | number | Number of hashtags to include | | includeEmojis | boolean | Include emojis | | callToAction | boolean | Include a call to action | | alternateVersions | number | Number of alternate versions |

Supported Platforms

  • twitter: 280 character limit, conversational tone
  • linkedin: 3000 character limit, professional tone
  • facebook: Long-form friendly, conversational
  • instagram: 2200 character limit, visual storytelling
  • mastodon: 500 character limit, community-focused
  • bluesky: 300 character limit, authentic tone

Email Types

  • newsletter: Regular updates and content
  • announcement: Product or feature announcements
  • promotional: Marketing and promotional content
  • transactional: Transaction-related emails

Integration Status

  • Logger: planned
  • Docs-Suite: ready (typedoc)
  • NeverHub: planned

License

Copyright (c) 2025 Bernier LLC. All rights reserved.