A CLI tool to quickly generate Electron applications with either React or Vite templates.
new-electron-app
is a command-line tool that helps you jumpstart your Electron development by providing pre-configured templates with either React or Vite. It takes care of all the setup so you can focus on building your application.
You can use this package in two ways:
npm install -g new-electron-app
Then you can create a new app anywhere:
new-electron-app my-electron-app
You can also use it directly with npx without installing:
npx new-electron-app my-electron-app
new-electron-app [project-name] [options]
If you donβt provide a project name, youβll be prompted for one.
--skip-install
: Skip installing dependencies--verbose
: Print additional logs--typescript
: Use TypeScript template (coming soon)Both templates include the following npm scripts:
npm start
: Start the application in development modenpm run build
: Build the application for productionmy-electron-app/
βββ node_modules/
βββ public/
β βββ electron.js # Main Electron process
β βββ index.html # HTML template
βββ src/
β βββ App.css # Application styles
β βββ App.js # Main React component
β βββ index.css # Global styles
β βββ index.js # React entry point
βββ package.json # Project dependencies and scripts
βββ .gitignore # Git ignore rules
my-electron-app/
βββ node_modules/
βββ dist/ # Built files (after build)
βββ src/
β βββ App.css # Application styles
β βββ App.jsx # Main React component
β βββ index.css # Global styles
β βββ main.jsx # React entry point
βββ electron.js # Main Electron process
βββ index.html # HTML template
βββ vite.config.js # Vite configuration
βββ package.json # Project dependencies and scripts
βββ .gitignore # Git ignore rules
Contributions are welcome! Please feel free to submit a Pull Request.
git checkout -b feature/amazing-feature
)git commit -m 'Add some amazing feature'
)git push origin feature/amazing-feature
)This project is licensed under the MIT License - see the LICENSE file for details.