Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

seo-info

Package Overview
Dependencies
Maintainers
0
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

seo-info

An SEO Analyzer for Single Page Applications (SPAs)

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

SEO Info

An SEO Analyzer for Single Page Applications (SPAs) that provides comprehensive insights into SEO metrics, accessibility, performance, and best practices.

Features

  • Command-Line Interface (CLI): Easily analyze websites directly from the terminal.
  • API Usage: Integrate the analyzer into Node.js projects and CI/CD pipelines.
  • Configurable Settings: Customize analysis parameters via configuration files or command-line options.
  • Detailed Reports: Generate reports in JSON, HTML, or PDF formats.
  • Accessibility Audit: Leverage Axe-core for in-depth accessibility analysis.
  • Performance Metrics: Use Lighthouse to gather key performance indicators.
  • CSR/SSR Detection: Determine if a site uses Client-Side or Server-Side Rendering.
  • Lazy Loading Detection: Identify lazy-loaded images and content.
  • JavaScript Dependency Analysis: Analyze JS dependencies and their impact on load times.
  • Error Handling: Robust error handling for network issues and missing resources.
  • Savings Report: Displays analysis statistics such as performance scores and accessibility issues.

Installation

Via NPM

Install globally to use the CLI anywhere:

npm install -g seo-info

Using NPX

Run without installation

npx seo-info <url> [options]

CLI Usage

Analyze a website by providing its URL

seo-info <url> [options]

Example

seo-info https://example.com --format html --output ./reports/example-report

CLI Options:

  • -c, --config: Path to a configuration file.
  • -0, --output: Output path for the report (without extension).
  • -f, --format: Format of the generated report (json, html, pdf).
  • -h, --help: Display help information.

API Usage

Integrate the analyzer into your Node.js projects:

import { analyzeSEO } from 'seo-info';

(async () => {
  const htmlContent = `
    <!DOCTYPE html>
    <html>
    <head>
      <title>Your SPA</title>
      <meta name="description" content="Description of your SPA">
      <!-- Other meta tags -->
    </head>
    <body>
      <!-- Your SPA content -->
    </body>
    </html>
  `;
  const baseUrl = 'https://example.com'; // Replace with your base URL

  const options = {
    imageSizeLimit: 200 * 1024, // 200KB
    timeout: 60000, // 60 seconds
    reportFormat: 'html',
    outputPath: './reports/seo-report',
  };

  try {
    const seoResults = await analyzeSEO(htmlContent, baseUrl, options);
    console.log('SEO analysis completed successfully.');
  } catch (error) {
    console.error('SEO analysis failed:', error.message);
  }
})();

Configurations

You can customize the analyzer using a configuration file using .seoinforc.

Create a .seoinforc file in JSON format in your project's root directory:

{
  "imageSizeLimit": 150000,
  "timeout": 60000,
  "thresholds": {
    "largeImageSize": 150000,
    "totalJsSize": 750000,
    "ssrContentLengthThreshold": 2000,
    "lazyLoadDelay": 1500
  },
  "reportFormat": "html",
  "outputPath": "./reports/seo-report"
}

Output Statistics

Each compression operation returns statistics such as:

  • Title: The title of the page.
  • Description: Meta description content.
  • Keywords: Meta keywords content.
  • Open Graph Data: Extracted Open Graph tags.
  • Headings: Structure of headings (h1 to h6).
  • Images: Details about images, including alt text and file size.
  • Performance Metrics: Key performance indicators from Lighthouse.
  • Accessibility Issues: Detailed accessibility findings from axe-core.
  • CSR/SSR Detection: Indicates whether the site uses Client-Side or Server-Side Rendering.
  • Lazy Loading Issues: Information about lazy-loaded content.
  • JavaScript Dependencies: Analysis of JS files and their sizes.

License

This project is licensed under the MIT License.

Keywords

FAQs

Package last updated on 16 Nov 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc