Skip to content

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 โ€‹

bash
# 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 โ€‹

javascript
// 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 โ€‹

bash
# Launch interactive script manager
scriptit run

Environment Management โ€‹

bash
# 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.

javascript
// 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:

bash
scriptit exec quick-test.js

๐Ÿ”ง Build Scripts & Automation โ€‹

Replace complex build tools with simple, readable scripts.

javascript
// 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.

javascript
// 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.

javascript
// 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.

bash
# 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 โ€‹

Released under the MIT License.