Node.js Runner - VS Code Extension
A powerful Visual Studio Code extension for executing JavaScript and TypeScript files with a simple play button and integrated console output.
✨ Features
🎯 Core Functionality
- ▶️ One-Click Execution: Play button directly in the editor toolbar
- 📊 Integrated Console: All output displayed directly in VS Code
- 🔄 Real-time Output: Live streaming of program output
- ⚡ Smart Detection: Automatic recognition of
.js
and .ts
files
- 🎛️ Flexible: Execute current file or
app.js
- 📋 Side Panel: Dedicated panel with file explorer and quick actions
🛠️ Advanced Features
- ⌨️ Keyboard Shortcuts:
Ctrl+F5
: Execute current file
Ctrl+Shift+F5
: Execute app.js
Ctrl+Shift+N
: Open Node.js Runner panel
Ctrl+Shift+X
: Stop running process
Ctrl+Shift+W
: Toggle watch mode
Ctrl+Shift+H
: Show execution history
- 🔄 Watch Mode: Auto-restart on file changes with live monitoring
- 📊 Execution Tracking: Time measurement and detailed execution history
- 🎨 Status Bar Integration: Live status with watch mode indicator
- 🛑 Process Control: Stop running processes with smart detection
- 🧹 Output Management: Clear and manage output with history
- ⚙️ Configurable: Customizable Node.js settings
- 🌐 Multi-language: English and German interface
📋 Side Panel
- 📁 File Explorer: Browse all JavaScript/TypeScript files in workspace
- ⚡ Quick Actions: One-click access to all commands
- ⚙️ Settings: View and modify extension settings
- 🔄 Auto-refresh: Automatically updates when files change
🚀 Quick Start
- Installation: Install the extension from VS Code Marketplace
- Open File: Open a
.js
or .ts
file
- Execute: Click the ▶️ play button in the toolbar or use
Ctrl+F5
- View Output: See results in the "Node.js Runner" output channel
- Panel Access: Click the Node.js Runner icon in the activity bar
📋 Usage
Action |
Shortcut |
Description |
Run Current File |
Ctrl+F5 |
Executes the currently opened file |
Run app.js |
Ctrl+Shift+F5 |
Executes app.js from workspace root |
Stop Running |
Ctrl+Shift+X |
Stops the running process |
Toggle Watch Mode |
Ctrl+Shift+W |
Auto-restart on file changes |
Execution History |
Ctrl+Shift+H |
View last 10 execution runs |
Clear Output |
- |
Clears the console |
Open Panel |
Ctrl+Shift+N |
Opens the Node.js Runner side panel |
Supported File Types
- ✅ JavaScript (
.js
) - Direct execution with Node.js
- ✅ TypeScript (
.ts
) - Automatic compilation with ts-node
Right-click on JavaScript/TypeScript files for quick access:
- ▶️ Run Node.js File
- ▶️ Run app.js
⚙️ Configuration
Go to VS Code Settings and search for "Node.js Runner":
{
"nodejs-runner.nodeExecutable": "node",
"nodejs-runner.clearOutputBeforeRun": true,
"nodejs-runner.showRunningIndicator": true,
"nodejs-runner.autoSaveBeforeRun": true,
"nodejs-runner.nodeArguments": [],
"nodejs-runner.language": "en"
}
Language Settings
- English:
"nodejs-runner.language": "en"
(default)
- German:
"nodejs-runner.language": "de"
Advanced Node.js Arguments
{
"nodejs-runner.nodeArguments": [
"--experimental-modules",
"--max-old-space-size=4096"
]
}
🎯 Examples
Example app.js
console.log('🚀 Hello from app.js!');
console.log('📅 Current time:', new Date().toLocaleString());
setTimeout(() => {
console.log('✅ Processing completed!');
console.log('- Version:', process.version);
console.log('- Platform:', process.platform);
}, 1000);
Example TypeScript
interface User {
name: string;
age: number;
}
const user: User = {
name: 'John Doe',
age: 30
};
console.log('👤 User:', user);
console.log('🎉 TypeScript is running perfectly!');
🔧 TypeScript Support
For TypeScript files you need ts-node
:
# Global installation
npm install -g ts-node
# Or project-local
npm install ts-node --save-dev
The extension automatically tries:
ts-node
(globally installed)
npx ts-node
(project-local)
📊 Output Channel Features
- 🔄 Status Indicators: Clearly recognizable symbols
- 📁 Path Display: Complete file path
- ⚙️ Configuration: Node.js version and arguments
- ✅/❌ Exit Codes: Success/error status
Example Output
🔄 Running: app.js
📁 Path: C:\\workspace\\app.js
⚙️ Node: node
--------------------------------------------------
🚀 Hello from app.js!
📅 Current time: 8/17/2025, 3:30:45 PM
✅ Processing completed!
--------------------------------------------------
✅ Process completed successfully (exit code: 0)
Scripts
npm run compile # Compile TypeScript
npm run watch # Watch mode for development
npm run package # Production build
npm run lint # Run ESLint
npm run test # Run tests
📂 Project Structure
node-js-engine/
├── src/
│ ├── extension.ts # Main extension code
│ ├── panels.ts # Side panel providers
│ ├── i18n/ # Internationalization
│ │ ├── index.ts # I18n manager
│ │ ├── en.ts # English translations
│ │ └── de.ts # German translations
│ └── test/ # Tests
├── resources/
│ └── icon.svg # Extension icon
├── package.json # Extension manifest
├── tsconfig.json # TypeScript config
├── webpack.config.js # Webpack config
└── README.md # This file
🐛 Troubleshooting
Node.js Not Found
# Install Node.js or configure path
"nodejs-runner.nodeExecutable": "C:\\Program Files\\nodejs\\node.exe"
TypeScript Errors
# Install ts-node
npm install -g ts-node
Permission Errors (Linux/Mac)
# Node.js executable permissions
chmod +x /usr/local/bin/node
🤝 Contributing
- Fork the repository
- Create feature branch:
git checkout -b feature/amazing-feature
- Commit changes:
git commit -m 'Add amazing feature'
- Push to branch:
git push origin feature/amazing-feature
- Open pull request
📄 License
MIT License
🎉 Changelog
0.0.3 (Current)
- 🔄 Watch Mode: Auto-restart on file changes (
Ctrl+Shift+W
)
- 📊 Execution Time Tracking: Display execution duration for each run
- 📋 Execution History: View last 10 runs with details (
Ctrl+Shift+H
)
- 🎯 Enhanced Status Bar: Watch mode indicator and improved UI
- ⌨️ New Shortcuts: Additional keyboard shortcuts for new features
- 🛠️ Improved Panels: Enhanced side panel with new actions
0.0.2
- 🔄 Dynamic Play/Stop Button: Button changes based on process state
- 🛑 Smart Process Detection: Automatic detection of running/stopped processes
- 🎨 Monochrome Icons: VS Code Activity Bar compliant icons
- 🐛 Bug Tracker Integration: Direct link to bug reporting system
- ⚙️ Fixed Configuration: Properly registered settings in VS Code
0.0.1
- ✨ Initial Release
- ▶️ Play Button Integration
- 📊 Output Channel Support
- ⌨️ Keyboard Shortcuts
- ⚙️ Configuration Options
- 🔄 Process Management
- 🎯 TypeScript Support
- 📋 Side Panel Integration
- 🌐 Multi-language Support (EN/DE)
💡 Roadmap
- [ ] 🔧 Environment Variables Support
- [ ] 📦 NPM Script Integration
- [ ] 🧪 Testing Framework Integration
- [ ] 🔍 Debugging Support
- [ ] 📈 Performance Monitoring
- [ ] 🌐 Remote Execution
Copyright © 2025 pyengine.de - All rights reserved
Developed with ❤️ for the VS Code Community
Feedback and feature requests are welcome! Create an issue on GitHub.