🚀 Big News:Socket Has Acquired Secure Annex.Learn More
Socket
Book a DemoSign in
Socket

gpreview

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gpreview

Preview Ghost themes locally without a full Ghost installation

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
11
-31.25%
Maintainers
1
Weekly downloads
 
Created
Source

Ghost Theme Preview

A lightweight, zero-config tool for previewing Ghost themes without running a full Ghost installation. Perfect for theme developers who want to test their Handlebars templates with mock data.

Installation

# Install globally
npm install -g gpreview

# Or use npx without installing
npx gpreview /path/to/your/theme

Quick Start

# Preview theme in current directory
gpreview

# Preview a specific theme
gpreview ./my-ghost-theme

# Use a custom port
gpreview ./my-ghost-theme -p 8080

Features

  • 🚀 Zero Configuration - Works out of the box with sensible defaults
  • 🎨 Full Theme Support - Renders all standard Ghost templates (index, post, page, tag, author)
  • 🔧 Ghost Helpers - Implements all essential Ghost Handlebars helpers
  • 📦 Built-in Mock Data - Includes sample posts, authors, tags, and pages
  • 🔄 Hot Reload - Changes to theme files are reflected immediately
  • 📁 Static Assets - Automatically serves CSS, JS, and images from your theme
  • 🎯 Template Fallbacks - Gracefully handles missing templates

Usage

CLI Options

gpreview [theme-path] [options]
  • theme-path - Path to Ghost theme directory (default: current directory)
  • -p, --port <number> - Port to run server on (default: 3000)
  • -d, --data <path> - Path to custom mock data JSON file
  • -w, --watch - Watch theme files for changes and auto-reload
  • -V, --version - Output the version number
  • -h, --help - Display help for command

Examples

# Preview current directory as theme
gpreview

# Preview a specific theme
gpreview /path/to/casper

# Use a different port
gpreview ./my-theme -p 8080

# Watch for file changes
gpreview ./my-theme -w

API Integration

You can also use this package programmatically:

const { PreviewServer } = require('gpreview');

const server = new PreviewServer({
  themePath: './my-theme',
  port: 3000,
});

server.start().then(() => {
  console.log('Theme preview running on http://localhost:3000');
});

Development

# Install dependencies
npm install

# Build TypeScript
npm run build

# Test with example themes
npm run preview dawn

# Run tests
npm test

Keywords

ghost

FAQs

Package last updated on 20 Jul 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