vako
v1.3.21
Published
๐ Ultra-modern Node.js framework with hot reload, plugins, authentication, TypeScript support, and Next.js integration
Downloads
2,279
Readme
๐ Vako
Ultra-modern and intelligent web framework for Node.js with Express and EJS, designed for rapid and efficient development with intelligent hot reload, beautiful logging, extensible plugin system, TypeScript support, Next.js integration, and revolutionary auto-updater.
โจ Features
๐ฏ Core Features
- ๐ฅ Intelligent Hot Reload - Selective reloading of modified routes
- ๐จ Beautiful Logging - Colorful logging system with icons and timestamps
- โก Integrated WebSocket - Real-time communication for development
- ๐ Auto-loading - Routes, views, and middleware auto-configured
- ๐ ๏ธ Development Mode - Advanced file monitoring
- ๐ Smart Prefetching - Route caching and prefetching
- ๐ Plugin System - Extensible architecture with hooks and complete API
- ๐ฃ๏ธ Dynamic Route Management - Create/delete routes on-the-fly
- ๐จ Advanced Layout System - Powerful templating with sections and helpers
- ๐ฆ Auto Module Installation - Automatic dependency management
๐ท TypeScript & Next.js (NEW in v1.3.0)
- ๐ท Full TypeScript Support - Complete type definitions included
- โ๏ธ Next.js Adapter - Seamless integration with Next.js
- ๐ Type Definitions - Full IntelliSense support
- ๐ Next.js Routes - Use Vako routes in Next.js applications
- ๐ Plugin Compatibility - Use Vako plugins in Next.js projects
๐ Security & Quality
- ๐ฌ Advanced Code Verification - Comprehensive code quality analysis
- ๐ HTML Reports - Beautiful verification reports with interactive dashboard
- ๐ Security Auditing - Advanced security vulnerability detection
- ๐งฎ Complexity Analysis - Cyclomatic complexity and performance metrics
๐ Auto-Updater
- ๐ Revolutionary Auto-Updater - The most advanced auto-updater in Node.js ecosystem
- ๐ก๏ธ Security-First Updates - Automatic critical security updates with rollback protection
- ๐พ Intelligent Backup System - Smart backups with one-click rollback
- ๐ฏ Multi-Channel Updates - Support for stable, beta, and alpha channels
- ๐จ Interactive CLI - Beautiful command-line interface with auto-completion
๐ Table of Contents
- Installation
- Quick Start
- TypeScript Support
- Next.js Integration
- Features
- Documentation
- Changelog
- Contributing
๐ Installation
Global Installation (CLI)
npm install -g vakoProject Installation
npm install vakoWith TypeScript
npm install vako
npm install -D typescript @types/node @types/express๐ฆ Quick Start
1. Create a New Project
# Create a new project
vako setup my-app
# With options
vako setup --name my-blog --template blog --git
# Available templates: default, api, blog, admin2. Basic Application
const { App } = require('vako');
const app = new App({
port: 3000,
viewsDir: 'views',
staticDir: 'public',
routesDir: 'routes',
layouts: {
enabled: true,
defaultLayout: 'main'
},
plugins: {
enabled: true,
autoLoad: true,
pluginsDir: 'plugins'
}
});
app.loadRoutes() // Automatically load all routes
.listen();3. Development Mode
const { startDev } = require('vako');
// Simple dev startup with hot reload
startDev({ port: 3000 });Or with the App class:
const { App } = require('vako');
const app = new App({
port: 3000,
isDev: true, // Enable development mode
wsPort: 3008, // WebSocket port for hot reload
watchDirs: ['views', 'routes', 'public'], // Watched directories
layouts: {
enabled: true,
defaultLayout: 'main'
},
plugins: {
enabled: true,
autoLoad: true,
pluginsDir: 'plugins'
}
});
app.loadRoutes().listen();4. CLI Commands
# Start development server
vako dev
# Start with custom port
vako dev --port 8080
# Create new project
vako setup my-project
# Create API project
vako setup --template api --name my-api
# Create blog project
vako setup --template blog --name my-blog
# Create admin project
vako setup --template admin --name admin-panel๐ท TypeScript Support
Vako includes complete TypeScript support with full type definitions.
Installation
npm install vako
npm install -D typescript @types/node @types/expressUsage
import { App, VakoOptions } from 'vako';
const options: VakoOptions = {
port: 3000,
isDev: true,
routesDir: 'routes',
plugins: {
enabled: true,
autoLoad: true
}
};
const app = new App(options);
app.loadRoutes();
app.listen();Type Definitions
All types are available in types/index.d.ts:
import {
App,
VakoOptions,
Plugin,
PluginContext,
NextJsAdapter
} from 'vako';โ๏ธ Next.js Integration
Vako can be seamlessly integrated with Next.js using the built-in adapter.
Installation
npm install vako next react react-domBasic Integration
// server.js (Custom Next.js server)
const express = require('express');
const next = require('next');
const { App, NextJsAdapter } = require('vako');
const vakoApp = new App({ port: 3001 });
vakoApp.loadRoutes();
const nextApp = next({ dev: true });
const handle = nextApp.getRequestHandler();
nextApp.prepare().then(() => {
const server = express();
const adapter = new NextJsAdapter({
nextApp: server,
enableVakoRoutes: true,
enableVakoPlugins: true,
routePrefix: '/api/vako'
});
adapter.integrateRoutes(vakoApp);
adapter.usePlugins(vakoApp);
server.use(adapter.middleware());
server.get('*', (req, res) => handle(req, res));
server.listen(3000, () => {
console.log('๐ Server ready on http://localhost:3000');
});
});Using Vako Plugins in Next.js
// pages/api/data.js
import vakoApp from '../../lib/vako-setup';
export default async function handler(req, res) {
// Use Vako plugins
const dbPlugin = vakoApp.pluginManager?.getPlugin('database');
const data = await dbPlugin?.getData();
res.status(200).json({ data });
}For more details, see Next.js Integration Guide.
๐ Changelog
๐ Version 1.3.3 (Latest) - January 2025
๐ง Fixes
- Fixed README display on npm - all references updated from "Veko.js" to "Vako"
- Updated binary names in package.json for correct npm CLI commands
- Fixed TypeScript types naming consistency
๐ Version 1.3.0 - January 2025
๐ TypeScript & Next.js Support
๐ท Full TypeScript Support
- Complete type definitions in
types/index.d.ts - TypeScript configuration (
tsconfig.json) - Full IntelliSense support
- Type-safe plugin development
- Complete type definitions in
โ๏ธ Next.js Adapter
- Seamless integration with Next.js
- Use Vako routes in Next.js applications
- Use Vako plugins in Next.js projects
- Middleware for exposing Vako functionality
๐ Documentation
- Next.js integration guide
- TypeScript examples
- Quick start guides
๐ง Improvements
- Updated package name to
vakofor npm publication - Enhanced plugin system with TypeScript support
- Improved error handling
- Better documentation structure
๐ Version 1.2.0 - December 2024
๐ Revolutionary Auto-Updater System
๐ Advanced Auto-Updater
- Automatic version checking with intelligent scheduling
- Multi-channel support (stable, beta, alpha, custom registries)
- Security-first approach with cryptographic validation
- Interactive CLI with beautiful colored interface
- Real-time notifications and progress indicators
๐ Security-First Architecture
- SHA512 integrity verification for all packages
- Automatic security updates with priority handling
- Rollback protection against failed updates
- Vulnerability scanning before installation
๐พ Smart Backup & Rollback System
- Automatic backup before every update
- Configurable backup retention (1-10 backups)
- Instant rollback in case of failure
- Emergency rollback functionality
๐ Version 1.1.0
- Initial plugin system implementation
- Basic layout system with EJS integration
- Hot reload functionality with WebSocket
- CLI commands (dev, setup, build, start)
- Basic logging system with colors
- Auto-loading for routes and middleware
๐ Plugin System
Vako includes a powerful and extensible plugin system.
Plugin Structure
// plugins/my-plugin.js
module.exports = {
name: 'my-plugin',
version: '1.0.0',
description: 'Description of my plugin',
defaultConfig: {
enabled: true,
option1: 'value'
},
async load(app, config, context) {
context.log('success', 'Plugin loaded!');
// Add a route
context.addRoute('get', '/my-plugin', (req, res) => {
res.json({ message: 'Hello from plugin!' });
});
// Add middleware
context.addMiddleware((req, res, next) => {
req.pluginData = { source: 'my-plugin' };
next();
});
}
};TypeScript Plugin
// plugins/my-plugin.ts
import { Plugin, PluginContext } from 'vako';
const myPlugin: Plugin = {
name: 'my-plugin',
version: '1.0.0',
async load(app, config, context: PluginContext) {
context.log('success', 'TypeScript plugin loaded!');
// ...
}
};
export default myPlugin;For more details, see Plugin Documentation.
๐จ Advanced Layout System
Vako includes a powerful layout system with sections and helpers.
const app = new App({
layouts: {
enabled: true,
layoutsDir: 'views/layouts',
defaultLayout: 'main',
sections: ['head', 'header', 'content', 'footer', 'scripts']
}
});Layout Helpers
// In your views
<% layout.title('My Page Title') %>
<% layout.meta('description', 'Page description') %>
<% layout.css('/css/custom.css') %>
<% layout.js('/js/custom.js') %>
<% layout.section('header', '<div>Custom Header</div>') %>๐ฅ Intelligent Hot Reload
Vako's hot reload system selectively reloads only what's necessary:
- Modified routes โ Route-only reload
- Modified views โ Light template reload
- Static files โ Full browser reload
- Modified plugins โ Specific plugin reload
- Modified layouts โ Layout cache clear and reload
๐ฃ๏ธ Route System
Automatic Routes
Vako automatically loads all routes from the routes/ folder:
routes/index.jsโ/routes/about.jsโ/aboutroutes/users/[id].jsโ/users/:id
Route File Format
// routes/users.js
module.exports = {
get: (req, res) => {
res.render('users', { users: [] });
},
post: (req, res) => {
const newUser = req.body;
res.status(201).json({ user: newUser });
}
};๐ Auto-Updater
Quick Start
# Global installation
npm install -g vako
# Check for updates
vako update check
# Update to latest version
vako update update
# Configure auto-updater
vako update config
# View statistics
vako update statsProgrammatic Usage
const { App } = require('vako');
const app = new App({
autoUpdater: {
enabled: true,
checkOnStart: true,
autoUpdate: false,
updateChannel: 'stable',
securityUpdates: true,
backupCount: 5,
checkInterval: 3600000,
rollbackOnFailure: true
}
});๐ Documentation
- Plugin System - Complete plugin documentation
- Authentication - Authentication system guide
- Next.js Integration - Next.js integration guide
- Quick Start Guide - Quick start with TypeScript and Next.js
๐ ๏ธ CLI Commands
# Development
vako dev # Start development server
vako dev --port 8080 # Custom port
vako dev --watch "src,views" # Custom watch directories
# Project Setup
vako setup my-app # Create new project
vako setup --template api # Create API project
vako setup --template blog # Create blog project
# Production
vako build # Build for production
vako start # Start production server
# Updates
vako update check # Check for updates
vako update update # Update to latest
vako update config # Configure auto-updater
vako update stats # View statistics๐ Project Structure
my-project/
โโโ routes/ # Route files
โ โโโ index.js # Route: /
โ โโโ api/
โ โโโ users.js # Route: /api/users
โโโ views/ # View templates
โ โโโ layouts/ # Layout templates
โ โโโ index.ejs
โโโ public/ # Static files
โ โโโ css/
โ โโโ js/
โโโ plugins/ # Custom plugins
โ โโโ my-plugin.js
โโโ types/ # TypeScript types (optional)
โโโ package.json๐ค Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Local Development
git clone https://github.com/sdevfr/vako.git
cd vako
npm install
npm run devTesting
npm test
npm run test:watch
npm run lint:check๐ License
MIT License - see LICENSE file for details.
๐ Links
- npm: https://www.npmjs.com/package/vako
- GitHub: https://github.com/sdevfr/vako
- Documentation: See
docs/folder - Issues: https://github.com/sdevfr/vako/issues
โญ Show Your Support
If you find Vako useful, please consider giving it a star on GitHub!
Vako v1.3.3 - Ultra-modern web framework with TypeScript support and Next.js integration ๐โจ
Built with โค๏ธ by the Vako team
