What is ScriptIt? โ
ScriptIt is a powerful, cross-runtime script runner designed to simplify JavaScript and TypeScript execution across different runtime environments. Whether you're using Bun, Node.js, or Deno, ScriptIt provides a unified interface with enhanced developer experience features.
The Problem โ
Modern JavaScript development involves multiple runtime environments, each with their own quirks and capabilities. Developers often face challenges like:
- Runtime fragmentation: Different commands and behaviors across Bun, Node.js, and Deno
- Environment management: Complex setup for different environments and configurations
- Debugging difficulties: Plain console output without visual distinction between log levels
- Script organization: No unified way to manage and execute scripts across projects
- Development workflow: Switching between different tools and interfaces
The Solution โ
ScriptIt addresses these challenges by providing:
๐ฏ Unified Interface โ
One tool that works consistently across all major JavaScript runtimes. Write once, run anywhere.
๐จ Enhanced Developer Experience โ
Beautiful colored console output, interactive TUI, and rich context for better debugging and monitoring.
๐ง Smart Environment Management โ
Automatic .env file loading, runtime detection, and configuration management.
โก Performance Optimized โ
Built with Bun in mind but optimized for all runtimes with minimal overhead.
๐ฆ Flexible Usage โ
Use as a CLI tool for quick scripts or integrate as a library in larger applications.
Key Features โ
Cross-Runtime Compatibility โ
# Same command works with any runtime
scriptit exec my-script.js --runtime bun
scriptit exec my-script.js --runtime node
scriptit exec my-script.js --runtime deno
Colored Console Output โ
// my-script.js - Automatic color coding for better visibility
export async function execute(context) {
const console = context.console || global.console;
console.log('Info message'); // White
console.error('Error message'); // Red
console.warn('Warning'); // Yellow
console.info('Information'); // Blue
console.debug('Debug info'); // Gray
}
Interactive Terminal UI โ
# Launch interactive script manager
scriptit run
Environment Management โ
# Automatic .env loading and environment setup
scriptit exec script.js --env production
Use Cases โ
๐ Rapid Prototyping โ
Quickly test ideas and concepts without setting up complex build processes.
// quick-test.js - Rapid prototyping script
export const description = "Quick API test script";
export async function execute(context) {
const console = context.console || global.console;
console.info('Testing API...');
const data = await fetch('https://api.example.com/data');
const json = await data.json();
console.log('API Response:', json);
return { success: true, data: json };
}
Run with:
scriptit exec quick-test.js
๐ง Build Scripts & Automation โ
Replace complex build tools with simple, readable scripts.
// build.js
export const description = "Build script with colored output";
export async function execute(context) {
const console = context.console || global.console;
console.info('Starting build process...');
// Your build logic here
console.log('โ
Build completed successfully');
return { success: true };
}
๐งช Testing & Debugging โ
Enhanced console output makes debugging more efficient.
// debug.js
export const description = "Debug script with enhanced logging";
export async function execute(context) {
const console = context.console || global.console;
console.debug('Starting debug session');
console.log('Processing user data:', userData);
console.warn('Deprecated API usage detected');
console.error('Critical error in payment processing');
return { debugComplete: true };
}
๐ Data Processing โ
Process data files with rich logging and error handling.
// process-data.js
export const description = "Data processing script";
export async function execute(context) {
const console = context.console || global.console;
const fs = require('fs');
console.info('Loading data file...');
const data = JSON.parse(fs.readFileSync('data.json', 'utf8'));
console.log(`Processing ${data.length} records`);
// Processing logic...
console.log('โ
Data processing complete');
return { recordsProcessed: data.length };
}
๐ CI/CD Integration โ
Integrate into continuous integration pipelines with consistent behavior.
# In your CI pipeline
scriptit exec deploy.js --runtime node --env production
Architecture โ
ScriptIt is built with a modular architecture:
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ CLI Interface โ โ Library API โ โ Terminal UI โ
โโโโโโโโโโโฌโโโโโโโโ โโโโโโโโโโโฌโโโโโโโโ โโโโโโโโโโโฌโโโโโโโโ
โ โ โ
โโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโ
โ Script Executor โ
โ (Core Engine) โ
โโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ โ
โโโโโโโผโโโโโโ โโโโโโโโโผโโโโโโโโ โโโโโโโโโผโโโโโโโโ
โ Bun โ โ Node.js โ โ Deno โ
โ Runtime โ โ Runtime โ โ Runtime โ
โโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโ
Core Components โ
- Script Executor: The heart of ScriptIt, handles script execution across runtimes
- Console Interceptor: Provides colored console output and enhanced logging
- Environment Manager: Handles .env files and environment variables
- Runtime Detector: Automatically detects and selects the best runtime
- TUI Engine: Powers the interactive terminal interface
Philosophy โ
ScriptIt is built on these core principles:
Developer First โ
Every feature is designed to improve the developer experience, from colored console output to interactive interfaces.
Runtime Agnostic โ
Support all major JavaScript runtimes without favoring one over another (though optimized for Bun).
Zero Configuration โ
Work out of the box with sensible defaults, but allow customization when needed.
Performance Conscious โ
Minimal overhead and efficient execution across all supported runtimes.
Extensible โ
Designed to be extended and integrated into larger workflows and applications.
Getting Started โ
Ready to try ScriptIt? Head over to the Getting Started guide to install and run your first script with colored console output!
Community โ
- ๐ Report Issues
- ๐ฌ Join Discussions
- ๐ Contribute
- โญ Star on GitHub