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

ai-marketing-campaign-optimizer

v1.0.0

Published

AI Marketing Campaign Optimizer - Multi-language toolkit for optimizing AI-powered marketing campaigns with content analysis, strategy frameworks, and automation utilities. Inspired by https://ai-cmo.net/

Readme

AI Marketing Campaign Optimizer - Node.js Implementation

This Node.js implementation was inspired by ai-cmo. It provides a comprehensive toolkit for analyzing marketing campaigns, evaluating content strategies, and calculating performance metrics with modern ES modules support.

Features

  • Campaign Strategy Evaluation - Analyze campaign parameters and generate strategic insights
  • Content Analysis - Evaluate marketing content for readability, SEO, and engagement potential
  • AI Prompt Generation - Create optimized prompts for AI-powered content generation
  • Key Phrase Extraction - Identify important phrases from marketing copy
  • ROI Calculation - Calculate return on investment with detailed metrics
  • ES Module Support - Modern JavaScript with import/export
  • Async/Await - Built-in async support for file operations

Installation

npm install ai-marketing-campaign-optimizer

Or clone and run locally:

git clone https://github.com/user/ai-cmo-net
cd ai-cmo-net/node
npm install

Usage

Running the Demo

npm start

Using as a Library

import {
  createCampaignStrategy,
  analyzeMarketingContent,
  generateAIPrompt,
  calculateCampaignROI
} from 'ai-marketing-campaign-optimizer';

// Create a campaign strategy
const strategy = createCampaignStrategy(
  'Q1 Product Launch',
  'B2B SaaS Decision Makers',
  ['Lead Generation', 'Brand Awareness']
);

console.log('Target Audience:', strategy.target_audience);
console.log('Primary Channels:', strategy.primary_channels);

// Analyze content
const metrics = analyzeMarketingContent(markdownContent);
console.log('Readability Score:', metrics.readability_score);
console.log('SEO Score:', metrics.seo_optimization);

Example: Campaign Analysis

import { createCampaignStrategy } from 'ai-marketing-campaign-optimizer';

const strategy = createCampaignStrategy(
  'Summer Sale Campaign',
  'E-commerce Shoppers',
  ['Sales', 'Brand Awareness', 'Customer Retention']
);

console.log(JSON.stringify(strategy, null, 2));

Example: Content Optimization

import { analyzeMarketingContent } from 'ai-marketing-campaign-optimizer';

const content = `
# Your Marketing Content Here

Analyze this content for marketing effectiveness.
`;

const metrics = analyzeMarketingContent(content);

console.log(`Word Count: ${metrics.word_count}`);
console.log(`Readability: ${metrics.readability_score}/100`);
console.log(`SEO Score: ${metrics.seo_optimization}/100`);
console.log(`Engagement Potential: ${metrics.engagement_potential}/100`);
console.log(`Detected Tone: ${metrics.tone_analysis}`);

Example: AI Prompt Generation

import { generateAIPrompt } from 'ai-marketing-campaign-optimizer';

const prompt = generateAIPrompt(
  'AI Marketing Automation Tools',
  'Professional',
  ['AI', 'marketing', 'automation', 'efficiency'],
  500
);

console.log('Generated Prompt:', JSON.stringify(prompt, null, 2));

API Reference

createCampaignStrategy(campaignName, targetAudience, goals)

Creates a new campaign strategy with channel recommendations and budget allocation.

analyzeMarketingContent(markdownContent)

Analyzes marketing content for multiple effectiveness metrics including:

  • Word count
  • Readability score (Flesch Reading Ease)
  • SEO optimization score
  • Engagement potential
  • Keyword density
  • Tone analysis

generateAIPrompt(topic, tone, keywords, targetLength)

Creates optimized prompts for AI content generation tools with constraints and outlines.

extractMarketingKeyPhrases(content, minFrequency)

Identifies and counts important phrases in marketing copy.

calculateCampaignROI(revenue, costs)

Calculates comprehensive ROI metrics including profit margin and ROAS.

Classes

CampaignStrategy

Represents a complete marketing campaign strategy with:

  • Target audience analysis
  • Content theme recommendations
  • Channel selection
  • Budget allocation
  • Recommended actions

ContentMetrics

Analyzes content and provides:

  • Readability assessment
  • SEO scoring
  • Engagement prediction
  • Tone detection

MarketingPromptGenerator

Generates AI prompts with:

  • Topic optimization
  • Tone alignment
  • Constraint generation
  • Content outlining

Development

Running Tests

npm test

Linting

npm run lint

Links

  • Source: ai-cmo
  • Repository: https://github.com/user/ai-cmo-net
  • npm: https://www.npmjs.com/package/ai-marketing-campaign-optimizer

License

MIT License - see LICENSE file for details