Doh.js delivers a uniquely productive JavaScript experience for Browser, Node.js, and Bun by replacing fragmented tooling with a deeply integrated core. This core is not a loose collection of features, but a layered architecture—from its foundational inheritance logic to its live, reactive runtime—engineered to provide a clear, consistent, and accelerated path from idea to application.
Modern JavaScript development often involves:
Doh offers a pragmatic approach focused on developer experience and productivity by addressing these challenges through a deeply integrated architecture.
Understanding Doh means looking beyond the surface features to the foundational pillars that support them. Each layer builds upon the previous, creating a robust and coherent system.
At the very heart of Doh lies its Resolution Order. This fundamental algorithm dictates how inheritance, conditions, and overrides behave consistently across the entire framework—from packages and modules to patterns and configuration pods. Mastering this single rule set is key to understanding Doh's predictable nature.
Before any resource can be resolved or loaded, it must be located. DohPath provides a stable, layered coordinate system (/
, ^/
, ./
) for all files and resources, ensuring consistent path handling across Node.js, browsers, and the Virtual File System (VFS) in exported applications. This underpins the load system, auto-packager, and more.
The Auto-Packager acts as Doh's "compiler pass." It analyzes your codebase, resolves dependencies using the Resolution Order, and generates Manifests. These manifests are pre-computed blueprints of your project (dependency graphs, pattern maps, etc.) that the runtime Load System consumes for instant resource availability, minimizing configuration and build times.
Doh.Loaded
CacheThe Doh Load System is the universal courier for all resources (JS, CSS, JSON, Modules, etc.). While Doh.load()
is the underlying imperative function, the system is most commonly used declaratively through the load
property in Packages Doh.Package(name, {load:[]})
and Modules Doh.Module(name, load, moduleFunction)
. It populates Doh.Loaded
, an in-memory, virtual file system cache that serves as the single source of truth for all runtime resources. This ensures every subsequent layer—patterns, HMR, data binding—operates on consistent, up-to-date information.
The Hot Virtual File System (HVFS) monitors file changes and updates Doh.Loaded
in real-time. Doh's Data Binding capabilities (observe
/mimic
) then propagate these changes into live objects and the DOM, enabling state updates without page refreshes. This synergy creates a highly reactive development environment.
The Pattern Engine is the human-facing Domain Specific Language (DSL) that allows developers to leverage the power of Doh's Resolution Order for object composition. Patterns provide a structured way to define reusable components with multiple inheritance, melded properties, and lifecycle management, forming the primary building blocks for applications.
SeeIf
): Runtime validation.Pods provide hierarchical configuration management, utilizing the same Resolution Order mechanism to scope settings for different environments, tenants, or application instances. This allows for adaptable deployments while keeping the core codebase generic and clean.
Dohballs complete a specific kind of distribution loop: packaging parts of a Doh project (folders containing one or more packages) into versioned, content-addressed archives for easy consumption by other Doh projects. They facilitate inter-project code sharing and reuse, distinct from primary application deployment to production (which typically uses Git or services like Doh Cloud). The Auto-Packager prepares these shareable units.
For a comprehensive understanding of how these components fit together, see the:
Beyond the core framework, Doh provides ready-to-use modules for common application needs, built upon the same foundational principles:
ajaxPromise
): Streamlined client-server communication.Here's a simple example of what Doh code looks like:
Doh.Module('MyApp', [
'browser?? styles.css'
], function() {
// Create a reusable component
Pattern('Counter', 'html', {
html: '<div>Count: <span id="count">0</span> <button id="increment">+</button></div>',
html_phase() {
this.count = 0;
this.e.find('#increment').onclick = () => this.increment();
},
increment() {
this.count++;
this.e.find('#count').textContent = this.count;
}
});
});
Get started with Doh in a few steps:
Install Doh
Windows:
powershell -c "irm deploydoh.com/install.ps1 | iex"
Mac/Linux/Unix:
curl -fsSL https://deploydoh.com/install | bash
Install Bun
doh install bun
Create a Web App
doh init webserver
This scaffolds a complete Express webserver, pre-configured with HVFS.
Run Your App
doh run
Visit http://localhost:3000
. Edit project files and see instant updates.
Run your Doh application:
doh run
Explore available commands:
doh help
Configure your app: Edit pod.yaml
(local settings) and boot.pod.yaml
(app-wide settings).
Doh might be helpful if you:
Doh is privately licensed by Disrupter L.L.C. (https://disrupter.com)