Node.js App Launcher with XML is a versatile PowerShell script that provides a graphical user interface (GUI) for managing and launching Node.js applications. Its unique feature is an entirely XML-driven UI, allowing for flexible customization of the interface without altering the PowerShell code. This tool simplifies common development tasks by offering quick access to npm commands, control over development servers, and easy management of .env configuration files.
Built by: Zachary Whiteman & Google Gemini Ai.
This script simplifies the management of your Node.js projects.
To run this script, you will need:
- Windows Operating System: (Windows 7 or later).
- PowerShell 5.1 or newer: This script leverages PowerShell's capabilities for GUI development and process management.
- Required .NET Assemblies:
System.Windows.Forms,System.Drawing(included with modern Windows installations). - Node.js and npm: Node.js and its package manager (
npm) must be installed and accessible in your system's PATH. ui.xmlfile: An XML file namedui.xmlmust be present in the same directory as the script, defining the GUI layout.
- Download: Download the
Node.JS App Launcher with XML.ps1script file. - Unblock: Right-click the file, go to Properties, and click
Unblockif the file was downloaded from the internet. - Place Files: Place
Node.JS App Launcher with XML.ps1and its accompanyingui.xmlfile in the root directory of your Node.js project. - Run: Execute the script from a PowerShell console or by double-clicking it.
.\Node.JS App Launcher with XML.ps1
The application assumes it is launched from the root directory of your Node.js project.
-
GUI Controls (as defined in
ui.xml):- "Install Dependencies" Button (e.g.,
btnInstall): Executesnpm installin your project directory. - "Run Dev Server" Button (e.g.,
btnRunDev): Executesnpm run devto start your development server. A visual indicator will change color. - "Stop Server" Button (e.g.,
btnStop): Terminates the running development server process. - "Open in Browser" Button (e.g.,
btnBrowser): Openshttp://localhost:3000(or your configured dev server URL) in your default web browser. - "Edit .env" Button (e.g.,
btnEnv): Copies a.env.localtemplate (from a hardcoded path) to your project as.envand opens it for editing. - Output Box (e.g.,
outputBox): Displays real-timestdoutandstderrfromnpmcommands.
- "Install Dependencies" Button (e.g.,
-
Closing the Application: If the dev server is running, the application will prompt you to stop it before closing.
- XML-driven User Interface: The entire GUI layout and initial properties are loaded dynamically from an external
ui.xmlfile, enabling easy customization of the launcher's appearance and functionality without script modification. - Streamlined Node.js Workflow: Provides one-click access to essential
npmcommands (npm install,npm run dev) directly from a desktop GUI. - Development Server Management: Offers dedicated buttons to start and gracefully stop your Node.js development server process.
- Integrated Browser Launch: Quickly open your local development server in your default web browser.
- .env File Utility: Facilitates easy creation and editing of
.envconfiguration files from a template. - Real-time Process Output: Displays standard output and error streams from executed
npmprocesses directly within the GUI. - Visual Status Indicator: Provides immediate visual feedback (e.g., color change) on the running status of the development server.
- Responsive GUI: Executes
npmcommands as background processes, ensuring the user interface remains interactive and responsive. - Graceful Exit: Prompts to stop running development servers before closing the application to prevent lingering processes.
The script is developed entirely in PowerShell, integrating with several key technologies:
- Scripting Language: PowerShell
- GUI Framework: .NET Windows Forms (WinForms) for the graphical user interface.
- UI Definition: XML for external and dynamic configuration of the user interface layout and controls.
- Process Management:
System.Diagnostics.Processfor asynchronous execution and control of externalnpmandNode.jsprocesses. - Operating System Interaction:
taskkillfor terminating processes andInvoke-Itemfor opening files and URLs. - File System Operations: Standard PowerShell cmdlets like
Join-Path,Copy-Item,Test-Pathfor managing project files.
Node.js App Launcher with XML operates by interacting with local development tools and files.
- External UI Configuration: The GUI's layout is loaded from
ui.xml. Ensure this file is trusted, as malicious XML could potentially influence UI behavior. - Local Process Execution: The script directly executes
npmcommands. It is assumed that Node.js and npm are installed correctly and their executables are trusted. - Hardcoded
.envTemplate Path: The path to the.envtemplate file (H:\Program Files\New+\Templates\.env.local) is hardcoded. For deployment or shared environments, this path should be made configurable withinui.xmlor via user settings for flexibility and security. - Process Control: Uses
taskkillto stop processes. This is a common method for terminating applications but requires appropriate permissions. - No Telemetry: The application does not collect or transmit any user data or telemetry.
Distributed under the MIT License. See LICENSE.txt for more information.
Zach Whiteman - elitesoftwarecolimited@gmail.com
HuggingFace - https://huggingface.co/EliteSoftware
HuggingFace (Personal) - https://huggingface.co/TheShadyRainbow
LinkTree - https://linktr.ee/zachrainbow