You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

@power-seo/content-analysis

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@power-seo/content-analysis

Yoast-style SEO content analysis engine with scoring, checks, and React components

Source
npmnpm
Version
1.0.2
Version published
Weekly downloads
8
-80.95%
Maintainers
1
Weekly downloads
 
Created
Source

@power-seo/content-analysis — Yoast-Style SEO Content Scoring Engine for React & Node.js

Keyword-focused content analysis with real-time scoring, readability checks, and actionable feedback — like Yoast SEO, but as a standalone TypeScript library that works anywhere.

npm version npm downloads License: MIT TypeScript tree-shakeable

@power-seo/content-analysis gives you a complete Yoast-style SEO scoring pipeline for any text content. Feed it a page's title, meta description, body HTML, focus keyphrase, images, and links — get back structured good / improvement / error results for every SEO factor. Run it server-side in a CMS, client-side in a React editor, or inside a CI content quality gate. All checks are individually configurable and tree-shakeable.

Zero runtime dependencies — only @power-seo/core as a peer.

Documentation

Features

  • Keyphrase density check — scores optimal 0.5–3% keyword frequency in body copy
  • Keyphrase distribution — verifies the focus keyword appears in the first 10% of content
  • Title checks — detects missing titles and keyphrase absence in the <title> tag
  • Meta description checks — validates presence, length (120–158 chars), and keyphrase inclusion
  • Heading structure — ensures H1 exists and that the keyphrase appears in at least one heading
  • Word count — flags pages under the 300-word minimum threshold
  • Image alt text — scans all images for missing alt attributes
  • Image keyphrase — checks whether at least one image alt contains the focus keyphrase
  • Internal and external link analysis — verifies outbound and inbound link presence
  • Configurable check suite — disable any individual check via disabledChecks config
  • Framework-agnostic — works in Next.js, Remix, Gatsby, Vite, vanilla Node.js
  • Full TypeScript support — complete type definitions for all inputs, outputs, and check IDs
  • Tree-shakeable — import only the checks you use; zero dead code in your bundle

Table of Contents

Installation

npm install @power-seo/content-analysis
yarn add @power-seo/content-analysis
pnpm add @power-seo/content-analysis

Quick Start

import { analyzeContent } from '@power-seo/content-analysis';

const result = await analyzeContent({
  keyphrase: 'react seo',
  title: 'How to Add SEO to React Apps',
  metaDescription:
    'A complete guide to adding SEO meta tags, Open Graph, and structured data in React.',
  bodyHtml: '<h1>React SEO Guide</h1><p>Search engine optimization for React...</p>',
  images: [{ src: '/hero.jpg', alt: 'React SEO diagram' }],
  links: {
    internal: ['https://example.com/blog'],
    external: ['https://developers.google.com/search'],
  },
});

console.log(result.score); // e.g. 82
console.log(result.results); // array of { id, status, message }

Usage

Running All Checks at Once

analyzeContent() runs all 13 built-in checks and returns an aggregated score (0–100) along with per-check results.

import { analyzeContent } from '@power-seo/content-analysis';

const output = await analyzeContent({
  keyphrase: 'next.js seo',
  title: 'Next.js SEO Best Practices',
  metaDescription:
    'Learn how to optimize your Next.js app for search engines with meta tags and structured data.',
  bodyHtml: htmlString,
  wordCount: 1250,
  images: imageList,
  links: { internal: internalLinks, external: externalLinks },
});

// output.score     → number 0–100
// output.results   → AnalysisResult[]
// output.status    → 'good' | 'improvement' | 'error'

Running Individual Checks

Each check is exported as a standalone function — useful when you want to run only a subset of the analysis.

import {
  checkTitle,
  checkMetaDescription,
  checkKeyphraseUsage,
  checkHeadings,
  checkWordCount,
  checkImages,
  checkLinks,
} from '@power-seo/content-analysis';

const titleResult = checkTitle({ keyphrase: 'react seo', title: 'React SEO Guide' });
// { id: 'title-keyphrase', status: 'good', message: 'Focus keyphrase found in title.' }

const wc = checkWordCount({ wordCount: 250 });
// { id: 'word-count', status: 'improvement', message: 'Word count is below 300 words.' }

Disabling Specific Checks

Pass config.disabledChecks to skip checks that don't apply to your content type (e.g. skip image checks on text-only pages):

import { analyzeContent } from '@power-seo/content-analysis';

const output = await analyzeContent(input, {
  disabledChecks: ['image-alt', 'image-keyphrase', 'external-links'],
});

Using in a React Editor

Integrate live scoring into a content editor — re-run analysis on every keystroke or debounced change:

import { useState, useEffect } from 'react';
import { analyzeContent } from '@power-seo/content-analysis';
import type { ContentAnalysisOutput } from '@power-seo/content-analysis';

function SeoScorePanel({ content }: { content: EditorContent }) {
  const [analysis, setAnalysis] = useState<ContentAnalysisOutput | null>(null);

  useEffect(() => {
    analyzeContent({
      keyphrase: content.keyphrase,
      title: content.title,
      metaDescription: content.description,
      bodyHtml: content.html,
    }).then(setAnalysis);
  }, [content]);

  if (!analysis) return null;

  return (
    <div>
      <p>SEO Score: {analysis.score}/100</p>
      {analysis.results.map((r) => (
        <div key={r.id} className={`check-${r.status}`}>
          {r.message}
        </div>
      ))}
    </div>
  );
}

API Reference

analyzeContent()

function analyzeContent(
  input: ContentAnalysisInput,
  config?: AnalysisConfig,
): Promise<ContentAnalysisOutput>;

ContentAnalysisInput

PropTypeDescription
keyphrasestringFocus keyphrase to analyze against
titlestringPage <title> content
metaDescriptionstringMeta description content
bodyHtmlstringFull body HTML string
wordCountnumberPre-computed word count (optional; auto-detected from bodyHtml if omitted)
imagesArray<{src: string; alt?: string}>Images found on the page
links{internal: string[]; external: string[]}Internal and external link URLs

ContentAnalysisOutput

FieldTypeDescription
scorenumberAggregate score 0–100
statusAnalysisStatus'good' (≥70) | 'improvement' (≥40) | 'error' (<40)
resultsAnalysisResult[]Per-check results

AnalysisResult

FieldTypeDescription
idCheckIdUnique check identifier
statusAnalysisStatus'good' | 'improvement' | 'error'
messagestringHuman-readable feedback

Individual Check Functions

FunctionChecks For
checkTitle(input)Title presence and keyphrase inclusion
checkMetaDescription(input)Description presence, length, keyphrase
checkKeyphraseUsage(input)Density (0.5–3%) and distribution
checkHeadings(input)H1 existence and keyphrase in headings
checkWordCount(input)Minimum 300-word threshold
checkImages(input)Alt text presence and keyphrase in alt
checkLinks(input)Internal and external link presence

Types

TypeDescription
CheckIdUnion of all 13 built-in check IDs
AnalysisConfig{ disabledChecks?: CheckId[] }
AnalysisStatus'good' | 'improvement' | 'error'
ContentAnalysisInputInput shape for analyzeContent()
ContentAnalysisOutputOutput shape from analyzeContent()

The @power-seo Ecosystem

All 17 packages are independently installable — use only what you need.

PackageInstallDescription
@power-seo/corenpm i @power-seo/coreFramework-agnostic utilities, types, validators, and constants
@power-seo/reactnpm i @power-seo/reactReact SEO components — meta, Open Graph, Twitter Card, breadcrumbs
@power-seo/metanpm i @power-seo/metaSSR meta helpers for Next.js App Router, Remix v2, and generic SSR
@power-seo/schemanpm i @power-seo/schemaType-safe JSON-LD structured data — 20 builders + 18 React components
@power-seo/content-analysisnpm i @power-seo/content-analysisYoast-style SEO content scoring engine with React components
@power-seo/readabilitynpm i @power-seo/readabilityReadability scoring — Flesch-Kincaid, Gunning Fog, Coleman-Liau, ARI
@power-seo/previewnpm i @power-seo/previewSERP, Open Graph, and Twitter/X Card preview generators
@power-seo/sitemapnpm i @power-seo/sitemapXML sitemap generation, streaming, index splitting, and validation
@power-seo/redirectsnpm i @power-seo/redirectsRedirect engine with Next.js, Remix, and Express adapters
@power-seo/linksnpm i @power-seo/linksLink graph analysis — orphan detection, suggestions, equity scoring
@power-seo/auditnpm i @power-seo/auditFull SEO audit engine — meta, content, structure, performance rules
@power-seo/imagesnpm i @power-seo/imagesImage SEO — alt text, lazy loading, format analysis, image sitemaps
@power-seo/ainpm i @power-seo/aiLLM-agnostic AI prompt templates and parsers for SEO tasks
@power-seo/analyticsnpm i @power-seo/analyticsMerge GSC + audit data, trend analysis, ranking insights, dashboard
@power-seo/search-consolenpm i @power-seo/search-consoleGoogle Search Console API — OAuth2, service account, URL inspection
@power-seo/integrationsnpm i @power-seo/integrationsSemrush and Ahrefs API clients with rate limiting and pagination
@power-seo/trackingnpm i @power-seo/trackingGA4, Clarity, PostHog, Plausible, Fathom — scripts + consent management

About CyberCraft Bangladesh

CyberCraft Bangladesh is a Bangladesh-based enterprise-grade software engineering company specializing in ERP system development, AI-powered SaaS and business applications, full-stack SEO services, custom website development, and scalable eCommerce platforms. We design and develop intelligent, automation-driven SaaS and enterprise solutions that help startups, SMEs, NGOs, educational institutes, and large organizations streamline operations, enhance digital visibility, and accelerate growth through modern cloud-native technologies.

Websiteccbd.dev
GitHubgithub.com/cybercraftbd
npm Organizationnpmjs.com/org/power-seo
Emailinfo@ccbd.dev

© 2026 CyberCraft Bangladesh · Released under the MIT License

Keywords

seo

FAQs

Package last updated on 21 Feb 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts