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

web-electron

v1.0.1

Published

CLI tool to convert web projects into Electron apps

Readme

Web-Electron CLI 🚀

A powerful command-line tool that automatically converts web projects into native desktop applications using Electron. Supports multiple frameworks and build systems with intelligent detection and configuration.

License: MIT npm version

✨ Features

  • 🔍 Intelligent Framework Detection - Automatically detects React projects and build systems
  • ⚡ Multiple Build System Support - Works with Vite, Create React App, and custom Webpack configurations
  • 📦 Smart Package Management - Supports npm, yarn, pnpm, and bun
  • 🛠️ TypeScript Ready - Full TypeScript support with proper type generation
  • 🎯 Zero Configuration - Works out of the box with sensible defaults
  • 🔧 Customizable Templates - Framework-specific Electron configurations
  • 📊 Project Validation - Comprehensive project analysis and validation

🚀 Quick Start

Installation

npm install -g web-electron

Convert Your Web Project

Navigate to your web project directory and run:

web-electron convert

Or specify a project path:

web-electron convert /path/to/your/project

📋 Commands

Convert Command

Convert a web project to an Electron desktop application:

web-electron convert [project-path] [options]

# Aliases
web-electron c [project-path] [options]

Options:

  • -y, --yes - Skip all prompts and use defaults
  • --no-install - Skip npm install

Examples:

# Convert current directory with prompts
web-electron convert

# Convert with auto-confirmation
web-electron convert -y

# Convert specific project without installing dependencies
web-electron convert ./my-react-app --no-install

Validate Command

Analyze and validate a web project for Electron conversion:

web-electron validate [project-path]

# Aliases
web-electron v [project-path]

Examples:

# Validate current directory
web-electron validate

# Validate specific project
web-electron validate ./my-project

Frameworks Command

Display all supported frameworks and build systems:

web-electron frameworks

# Aliases
web-electron f

🎯 Supported Frameworks

| Framework | Icon | Build Systems | Status | | ----------- | ---- | -------------------------------------- | ------------------ | | React | ⚛️ | Vite, Create React App, Custom Webpack | ✅ Fully Supported | | Next.js | ⚡ | Next.js CLI, Vite | 🚧 Coming Soon | | Vue | 🖖 | Vite, Vue CLI | 🚧 Coming Soon | | Nuxt | 💚 | Nuxt CLI, Vite | 🚧 Coming Soon |

React Support Details

  • Create React App - Full support with automatic configuration
  • Vite + React - Optimized build configuration and hot reload
  • Custom Webpack - Manual webpack configurations
  • TypeScript - Full TypeScript support across all React variants

🏗️ What Gets Generated

When you convert your project, the tool creates:

your-project/
├── electron/
│   ├── main.js (or .ts)      # Main Electron process
│   ├── preload.js (or .ts)   # Preload script for security
│   ├── handlers/             # IPC handlers directory
│   │   └── app-handlers.js   # Application-specific handlers
│   └── builder.js            # Electron builder configuration
├── package.json              # Updated with Electron scripts
└── [your existing files]     # Your web app remains unchanged

Updated Scripts

Your package.json gets new scripts for Electron development:

{
  "scripts": {
    "electron": "electron electron/main.js",
    "electron:dev": "concurrently \"npm run dev\" \"wait-on http://localhost:3000 && electron electron/main.js\"",
    "electron:build": "npm run build && electron-builder",
    "electron:dist": "npm run build && electron-builder --publish=never"
  }
}

🔧 Configuration

Framework Detection

The tool automatically detects your framework by analyzing:

  • package.json dependencies
  • Configuration files (vite.config.js, next.config.js, etc.)
  • Project structure and build patterns
  • Development server configuration

Build System Detection

Supports detection of:

  • Vite - Modern build tool with HMR
  • Create React App - React's official create-app tool
  • Custom Webpack - Manual webpack configurations

Package Manager Detection

Automatically detects and uses:

  • npm - Node.js default package manager
  • yarn - Fast, reliable package manager
  • pnpm - Efficient package manager
  • bun - Ultra-fast JavaScript runtime and package manager

🎨 Customization

Template Customization

The generated Electron files are based on framework-specific templates that can be customized:

  • Main Process - Handles app lifecycle and window management
  • Preload Script - Secure bridge between main and renderer processes
  • IPC Handlers - Communication between processes
  • Builder Config - Electron packaging and distribution settings

Development Workflow

  1. Development Mode: Runs your web dev server alongside Electron
  2. Hot Reload: Changes to your web app automatically reload in Electron
  3. TypeScript Support: Full IntelliSense and type checking
  4. Debugging: Chrome DevTools integration for both processes

🔍 Project Validation

The validation feature provides detailed analysis:

  • Framework Detection - Identifies your web framework
  • Build System Analysis - Detects build tools and configuration
  • Dependency Check - Validates required dependencies
  • TypeScript Detection - Checks for TypeScript usage
  • Development Server - Analyzes dev server configuration
  • Build Output - Validates build output structure

🚨 Requirements

  • Node.js 16.0.0 or higher
  • npm/yarn/pnpm/bun for package management
  • React-based web project (Create React App, Vite + React, or custom Webpack setup)

🤝 Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

Development Setup

# Clone the repository
git clone https://github.com/your-username/web-electron-cli.git

# Install dependencies
npm install

# Link for local development
npm link

# Test the CLI
web-electron --help

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.

🆘 Support

🎯 Roadmap

  • [ ] Next.js Support - SSR/SSG conversion, API route handling, and routing integration
  • [ ] Vue.js Framework - Vue 3 support with Vite and Vue CLI
  • [ ] Nuxt.js Support - Vue meta-framework with SSR/SSG capabilities
  • [ ] Angular Framework - Angular CLI and standalone component support
  • [ ] Svelte/SvelteKit - Compile-time optimization and routing support
  • [ ] Electron auto-updater integration
  • [ ] Cross-platform build optimization
  • [ ] Plugin system for custom frameworks
  • [ ] GUI version of the CLI tool

Made with ❤️ for the web development community