๐Ÿš€ Launch Week Day 4:Introducing the Alert Details Page: A Better Way to Explore Alerts.Learn More โ†’
Socket
Book a DemoInstallSign in
Socket

@mitre/nuxt-smartscript

Package Overview
Dependencies
Maintainers
5
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mitre/nuxt-smartscript

Smart typography transformations for Nuxt - automatic superscript, subscript, and symbol formatting

Source
npmnpm
Version
0.4.0
Version published
Weekly downloads
0
-100%
Maintainers
5
Weekly downloads
ย 
Created
Source

Nuxt SmartScript

npm version npm downloads License Nuxt

Smart typography transformations for Nuxt - automatic superscript, subscript, and symbol formatting.

Features

  • ๐Ÿ”ค Trademark, Registered & Copyright Symbols - Converts (TM) โ†’ โ„ข, (R) โ†’ ยฎ, and (C) โ†’ ยฉ
  • ๐Ÿ”ข Ordinal Numbers - 1st, 2nd, 3rd with proper superscript
  • ๐Ÿงช Chemical Formulas - H2O, CO2 with subscripts
  • ๐Ÿ“ Mathematical Notation - x^2 superscript, x_1 subscript
  • ๐Ÿš€ Full SSR/SSG Support - Server-side rendering and static generation (v0.4.0+)
  • ๐ŸŽฏ 30+ HTML Elements - Headings, paragraphs, lists, tables, links, and more
  • โšก Performance Optimized - Debounced processing, batch updates, caching
  • ๐ŸŽจ Fully Customizable - CSS variables and configurable selectors
  • โ™ฟ Accessible - Proper ARIA labels for screen readers
  • ๐Ÿ”ง TypeScript Support - Full type safety with module builder

Quick Setup

Install the module:

# npm
npm install @mitre/nuxt-smartscript

# pnpm
pnpm add @mitre/nuxt-smartscript

# yarn
yarn add @mitre/nuxt-smartscript

Add to your nuxt.config.ts:

export default defineNuxtConfig({
  modules: ['@mitre/nuxt-smartscript']
})

That's it! The plugin will automatically process your content โœจ

Architecture

The module follows a modular architecture for maintainability:

src/runtime/
โ”œโ”€โ”€ plugin.ts                 # Main plugin orchestrator
โ”œโ”€โ”€ composables/
โ”‚   โ””โ”€โ”€ useSmartScript.ts    # Vue composable for components
โ””โ”€โ”€ smartscript/
    โ”œโ”€โ”€ types.ts             # TypeScript interfaces
    โ”œโ”€โ”€ config.ts            # Configuration management
    โ”œโ”€โ”€ patterns.ts          # Regex patterns & matchers
    โ”œโ”€โ”€ processor.ts         # Text processing logic
    โ”œโ”€โ”€ dom.ts               # DOM manipulation utilities
    โ”œโ”€โ”€ engine.ts            # Core processing engine
    โ”œโ”€โ”€ errors.ts            # Error handling & recovery
    โ””โ”€โ”€ index.ts             # Public API exports

Configuration

Customize the behavior in nuxt.config.ts:

export default defineNuxtConfig({
  modules: ['@mitre/nuxt-smartscript'],
  
  smartscript: {
    // Customize positioning for your font
    positioning: {
      trademark: {
        body: '-0.5em',
        headers: '-0.7em'
      },
      registered: {
        body: '-0.25em',
        headers: '-0.45em'
      }
    },
    
    // Performance tuning
    performance: {
      debounce: 100,
      batchSize: 50
    }
  }
})

Vue Composable

Use in your components:

<script setup>
const { process, stats, isProcessing } = useSmartScript()

// Manually trigger processing
onMounted(() => {
  process()
})
</script>

<template>
  <div>
    <p>Processed: {{ stats.total }} transformations</p>
  </div>
</template>

Contributing

We welcome contributions! Please see CONTRIBUTING.md for detailed guidelines.

Development

This module is built using @nuxt/module-builder for proper TypeScript support and Nuxt ecosystem compatibility.

# Install dependencies
pnpm install

# Prepare development (generates types and stubs)
pnpm dev:prepare

# Run development playground
pnpm dev

# Run tests
pnpm test

# Build module
pnpm prepack

# Lint code
pnpm lint

For Contributors: This module uses a two-type system (ModuleOptions for users, SuperscriptConfig for runtime) to handle Nuxt's configuration transformation. See Contributing Guide and TypeScript Architecture for details.

License

Apache-2.0 - MITRE Corporation

Keywords

nuxt

FAQs

Package last updated on 25 Aug 2025

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