
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
WEB-MOJO - A lightweight JavaScript framework for building data-driven web applications
WEB-MOJO is a modern, lightweight JavaScript framework for building data-driven web applications. Built with a core + extensions architecture, WEB-MOJO provides maximum flexibility while maintaining clean boundaries and optimal performance.
Part of the MOJO Framework Family - WEB-MOJO is the browser-based framework. See our other MOJO frameworks for native mobile and desktop applications.
Complete guides covering:
🏗️ Core + Extensions Architecture - Clean separation with plugin system
📦 Subpath Exports - Import exactly what you need
⚡ Lazy Loading - Reduced bundle sizes with dynamic imports
🔌 Plugin System - Extensions enhance core without dependencies
🎯 Tree Shaking - Optimized builds with modern bundlers
🎨 Mustache Templates - Logic-less templates with 70+ formatters
📊 Data-Driven - Model and Collection classes with REST API integration
🎭 Event Delegation - Convention-based event handling
npm install web-mojo
// Core framework
import { WebApp, Page, View } from 'web-mojo';
// Create a simple page
class HomePage extends Page {
constructor(options = {}) {
super({
template: `
<div class="home">
<h1>Welcome to WEB-MOJO!</h1>
<p>Building modern web apps made simple.</p>
</div>
`,
...options
});
}
}
// Initialize app
const app = new WebApp({
name: 'My App',
container: '#app'
});
app.registerPage('home', HomePage);
app.start();
import { View, Model } from 'web-mojo';
class User extends Model {
urlRoot = '/api/users';
}
class UserProfileView extends View {
template = `
<div class="profile">
<h2>{{model.name}}</h2>
<p>{{model.email}}</p>
<p>Member since: {{model.created_at|date}}</p>
</div>
`;
}
// Usage
const user = new User({ id: 123 });
await user.fetch();
const view = new UserProfileView({ model: user });
await view.render();
await view.mount(document.body);
WEB-MOJO uses a core + extensions architecture:
web-mojo)The stable runtime and building blocks:
Feature-rich packages that extend core functionality:
web-mojo/auth)Complete authentication system with JWT tokens, login/register forms, and session management.
web-mojo/lightbox)Image and PDF viewers with editing capabilities including cropping and annotation.
web-mojo/charts)Interactive charts built on Chart.js with PieChart, SeriesChart, and more.
web-mojo/docit)Full-featured documentation portal system with markdown editing and syntax highlighting.
web-mojo/map)MapLibre GL integration with geolocation tracking and custom controls.
web-mojo/loader)Beautiful loading animations and progress indicators.
Views are the building blocks of your UI with a complete lifecycle:
import { View } from 'web-mojo';
class TodoView extends View {
template = `
<div class="todo {{#completed}}completed{{/completed}}">
<input type="checkbox" {{#completed}}checked{{/completed}} data-action="change:toggle">
<span>{{title}}</span>
<button data-action="click:remove">×</button>
</div>
`;
toggle() {
this.model.set('completed', !this.model.get('completed'));
this.model.save();
}
remove() {
this.model.destroy();
}
}
Models manage your data with built-in REST API integration:
import { Model } from 'web-mojo';
class Todo extends Model {
urlRoot = '/api/todos';
defaults() {
return {
title: '',
completed: false,
created_at: new Date()
};
}
validate(attrs) {
if (!attrs.title || attrs.title.trim() === '') {
return 'Title is required';
}
}
}
// Usage
const todo = new Todo({ title: 'Learn WEB-MOJO' });
await todo.save(); // POST /api/todos
todo.set('completed', true);
await todo.save(); // PUT /api/todos/123
Logic-less templates with powerful data formatting:
template = `
<div class="user-card">
<h3>{{model.name|uppercase}}</h3>
<p>{{model.email|lowercase}}</p>
<p>Joined: {{model.created_at|date:'MMM dd, YYYY'}}</p>
<p>Revenue: {{model.total_revenue|currency}}</p>
{{#model.is_active|bool}}
<span class="badge-success">Active</span>
{{/model.is_active|bool}}
</div>
`;
70+ built-in formatters for dates, numbers, text, HTML, and more!
Clean event handling with data attributes:
class ButtonView extends View {
template = `
<button data-action="click:handleClick">Click Me</button>
<input data-action="input:handleInput" placeholder="Type here">
`;
handleClick(e) {
console.log('Button clicked!');
}
handleInput(e) {
console.log('Input value:', e.target.value);
}
}
Build admin portals and dashboards with PortalApp:
import { PortalApp, Page } from 'web-mojo';
const app = new PortalApp({
name: 'Admin Portal',
sidebar: {
menus: [{
title: 'Main',
items: [
{ text: 'Dashboard', route: 'dashboard', icon: 'bi-speedometer2' },
{ text: 'Users', route: 'users', icon: 'bi-people' },
{ text: 'Settings', route: 'settings', icon: 'bi-gear' }
]
}]
}
});
app.registerPage('dashboard', DashboardPage);
app.registerPage('users', UsersPage);
app.start();
Our documentation is organized into focused sections — browse online or click any link below:
onEnter/onExit, paramsWEB-MOJO follows these core principles:
→ Read More About Our Philosophy
# Clone repository
git clone https://github.com/NativeMojo/web-mojo.git
cd web-mojo
# Install dependencies
npm install
# Run development server
npm run dev
# Build for production
npm run build
# Run tests
npm test
web-mojo/
├── src/
│ ├── core/ # Core framework (View, Model, Collection, Router…)
│ ├── extensions/ # Optional extensions (charts, maps, admin, auth…)
│ └── styles/ # CSS styles
├── docs/
│ └── web-mojo/ # Framework documentation (served on GitHub Pages)
│ ├── core/ # WebApp, PortalApp, View, Model, Collection, Events…
│ ├── pages/ # Page (routed screens)
│ ├── services/ # Rest, ToastService, WebSocketClient
│ ├── components/ # Sidebar & TopNav, Dialog, TableView, ListView…
│ ├── extensions/ # Charts, Admin, Maps, LightBox, TabView, FileUpload…
│ ├── models/ # Built-in models (User, Group, Job, Email…)
│ ├── utils/ # MOJOUtils
│ ├── mixins/ # EventEmitter & EventDelegate
│ ├── README.md # Documentation index
│ └── index.html # Interactive documentation portal
├── examples/ # Working example projects
└── tests/ # Test suites
We welcome contributions! Please:
Documentation improvements are especially welcome! Ensure:
Apache 2.0 - See LICENSE file
Built with ❤️ by the NativeMojo team
FAQs
WEB-MOJO - A lightweight JavaScript framework for building data-driven web applications
We found that web-mojo demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.