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-rewriter

v1.2.0

Published

AI-powered content rewriting service for tone transformation, style conversion, and commit message generation

Readme

@bernierllc/ai-content-rewriter

AI-powered content rewriting service for tone transformation, style conversion, and commit message generation.

Features

  • Tone Transformation: Convert content between professional, casual, friendly, technical, and engaging tones
  • Style Conversion: Transform between formal, casual, simple, technical, conversational, and creative styles
  • Content Simplification: Make complex content accessible to different audiences
  • Commit Message Generation: Generate semantic git commit messages from code changes
  • SEO Optimization: Optimize content with natural keyword integration
  • Batch Operations: Process multiple content pieces simultaneously
  • Provider Flexibility: Works with OpenAI or Anthropic with automatic fallback
  • NeverHub Integration: Optional service discovery and event publishing

Installation

npm install @bernierllc/ai-content-rewriter

Usage

Basic Content Rewriting

import { AIContentRewriter } from '@bernierllc/ai-content-rewriter';

const rewriter = new AIContentRewriter({
  openaiApiKey: process.env.OPENAI_API_KEY
});

await rewriter.initialize();

const result = await rewriter.rewriteContent(
  'Your original content here...',
  {
    targetTone: 'professional',
    targetAudience: 'enterprise',
    preserveKeyPoints: true
  }
);

console.log('Rewritten:', result.rewritten);
console.log('Improvement Score:', result.improvementScore);

Tone Transformation

// Casual to Professional
const formalResult = await rewriter.casualToFormal(
  "Hey! Check out this cool new feature we built!"
);

// Professional to Casual
const casualResult = await rewriter.formalToCasual(
  "We are pleased to announce enhanced functionality."
);

Generate Commit Messages

const commitResult = await rewriter.generateCommitMessage({
  files: ['src/auth.ts', 'src/user.ts'],
  additions: 45,
  deletions: 12,
  diff: '... git diff output ...'
}, {
  includeBody: true,
  conventional: true
});

console.log(commitResult.commitMessage);
// Output:
// "feat(auth): Add JWT token validation
//
// - Implement JWT validation middleware
// - Add token refresh endpoint
// - Update user authentication flow"

Technical Simplification

const simplifiedResult = await rewriter.technicalToSimple(
  `This implementation utilizes a singleton pattern with lazy initialization
   to ensure thread-safe instantiation of the database connection pool.`
);

SEO Optimization

const seoResult = await rewriter.optimizeForSEO(
  'Learn about building web applications with modern frameworks.',
  ['TypeScript', 'React', 'Next.js', 'full-stack development']
);

Batch Rewriting

const batchResult = await rewriter.batchRewrite([
  {
    id: 'post-1',
    content: 'Technical content...',
    options: { targetAudience: 'beginners', targetStyle: 'simple' }
  },
  {
    id: 'post-2',
    content: 'Casual content...',
    options: { targetTone: 'professional', targetStyle: 'formal' }
  }
]);

console.log(`Success: ${batchResult.successCount}/${batchResult.totalProcessed}`);

API Reference

AIContentRewriter

Constructor Options

interface AIContentRewriterConfig {
  openaiApiKey?: string;           // OpenAI API key
  anthropicApiKey?: string;         // Anthropic API key (future)
  primaryProvider?: 'openai' | 'anthropic';
  fallbackProvider?: 'openai' | 'anthropic';
  defaultOptions?: RewriteOptions;
  enableAnalytics?: boolean;
  neverhubConfig?: NeverHubConfig;
}

Core Methods

  • initialize(): Initialize the service and providers
  • shutdown(): Gracefully shutdown the service
  • rewriteContent(content, options): Rewrite content with options
  • transformTone(content, tone): Transform content tone
  • transformStyle(content, style): Convert content style
  • simplifyContent(content, audience?): Simplify complex content
  • makeEngaging(content, platform?): Make content more engaging

Specialized Methods

  • generateCommitMessage(changes, options?): Generate git commit messages
  • technicalToSimple(content): Convert technical to simple
  • casualToFormal(content): Convert casual to formal
  • formalToCasual(content): Convert formal to casual
  • optimizeForSEO(content, keywords): Optimize for SEO

Batch Operations

  • batchRewrite(contents): Process multiple contents
  • getAnalytics(timeRange): Get analytics data

Types

type ContentTone = 'professional' | 'casual' | 'friendly' | 'technical' | 'engaging' | 'formal';
type ContentStyle = 'formal' | 'casual' | 'simple' | 'technical' | 'conversational' | 'creative';
type SocialPlatform = 'twitter' | 'linkedin' | 'facebook' | 'instagram' | 'mastodon' | 'bluesky';

License

Copyright (c) 2025 Bernier LLC. See LICENSE for details.