npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

create-xianfires

v1.0.93

Published

Simple JS Framework for Events Driven Programming

Readme

XianFire Framework Documentation

Engineered by Christian I. Cabrera — Instructor I, College of Computer Studies
Lightweight JS Framework for Events-Driven & Integrative Programming 2

🔥 Overview

XianFire is a minimal, Lightweight JS Framework for rapidly scaffolding full-stack web applications with built-in authentication, database integration (MySQL or MongoDB), Electron desktop app support, and dynamic code generation.

Designed for fast prototyping, student projects, desktop applications, and small-to-medium applications — especially for Events-Driven Programming and Integrative Programming 2 at Mindoro State University.

✨ Key Features

✅ Express.js server with session-based auth
✅ MySQL (Sequelize) or MongoDB (Mongoose) support
Electron desktop app integration
✅ Auto-generated CRUD templates
✅ CLI generator for models & controllers (create:model, create:controller)
✅ Built-in migration system
.xian custom template engine
✅ Tailwind CSS ready
✅ Zero-config setup
Cross-platform desktop builds

📦 Installation & Setup

1. Generate a new project

npm create xianfires@latest myApp

You'll be prompted to choose:

  • Template Type: Default Template or With CRUD Functions
  • Database: MongoDB or MySQL
  • Electron: Include Electron for desktop app support (optional)

💡 If you don't specify a name, it defaults to xianfire-app.

2. Install dependencies

cd myApp
npm install

3. Run database migration

npm run migrate

✅ Creates database (MySQL) or collections (MongoDB) + syncs models.

4. Start development server

npm run xian

🌐 Web app runs at → http://localhost:3000

5. (If Electron chosen) Run desktop app

# Development mode (server + Electron)
npm run xian-dev

# Production build
npm run xianca

🗂️ Project Structure

myApp/
├─ controllers/
│  ├─ authController.js      # Login/Register/Dashboard logic (if CRUD)
│  ├─ homeController.js      # Home page handler
│  └─ *.js                   # Your generated controllers
├─ models/
│  ├─ db.js                  # Sequelize connection (MySQL only)
│  ├─ userModel.js           # Default User model
│  └─ *.js                   # Your generated models
├─ routes/
│  └─ index.js               # Main route definitions
├─ views/
│  ├─ home.xian
│  ├─ login.xian             # If CRUD template chosen
│  ├─ register.xian
│  ├─ dashboard.xian
│  └─ *.xian                 # Your custom views
├─ public/
│  └─ tailwind.css           # Pre-configured Tailwind
├─ electron/                 🆕 Electron desktop app files
│  └─ main.js                # Electron main process
├─ create.js                 # CLI generator for models & controllers
├─ migrate.js                # Database initializer
├─ index.js                  # Server entry point
├─ package.json
└─ node_modules/

⚡ Core Features

1. .xian Template Engine

Render views with res.render("filename") — no complex templating needed.

Example: views/home.xian

<!DOCTYPE html>
<html>
<head>
  <title>Home</title>
  <link href="/tailwind.css" rel="stylesheet">
</head>
<body class="bg-gray-50">
  <h1 class="text-3xl font-bold text-center mt-10">Welcome to XianFire 🔥</h1>
  <p class="text-center mt-4">Home Page</p>
</body>
</html>

2. Authentication (CRUD Template Only)

| Route | Method | Description | |------------------|--------|---------------------------------| | / | GET | Home page | | /login | GET | Render login form | | /login | POST | Authenticate user | | /register | GET | Render registration form | | /register | POST | Create new user | | /dashboard | GET | Protected dashboard (session) | | /logout | GET | Destroy session & redirect | | /forgot-password| GET | Forgot password page (stub) |

3. Database Support

🐘 MySQL (Sequelize)

  • Connection defined in models/db.js
  • Models use sequelize.define()
  • Migration creates DB + tables

🍃 MongoDB (Mongoose)

  • Connection handled in migrate.js
  • Models use mongoose.Schema
  • Migration ensures collections exist

4. 🖥️ Electron Desktop App (Optional)

XianFire includes seamless Electron integration:

  • Single codebase: Same app runs as web and desktop
  • Automatic server management: Express server runs inside Electron
  • Native menus: File and View menus with standard shortcuts
  • Cross-platform: Build for Windows, macOS, and Linux

Electron Features:

  • Native window with proper dimensions (1200x800)
  • Development tools integration
  • Standard application menu
  • Secure context isolation
  • Build system ready for distribution

🧰 CLI Code Generator

After project setup, generate models and controllers dynamically:

➕ Generate a Model

npm run create:model Product

→ Creates models/Product.js:

import { DataTypes } from "sequelize";
import { sequelize } from "./db.js";

export const Product = sequelize.define("Product", {
  name: { type: DataTypes.STRING, allowNull: false },
  email: { type: DataTypes.STRING, allowNull: false },
  password: { type: DataTypes.STRING, allowNull: false }
});

export { sequelize };

✅ Fields are customizable — edit after generation.

➕ Generate a Controller

npm run create:controller productController

→ Creates controllers/productController.js with full CRUD:

import { Product } from "../models/Product.js";

export const getAllProducts = async (req, res) => { ... };
export const createProduct = async (req, res) => { ... };
export const getProductById = async (req, res) => { ... };
export const updateProduct = async (req, res) => { ... };
export const deleteProduct = async (req, res) => { ... };

✅ Auto-imports matching model. Uses PascalCase ↔ camelCase conversion.

🚀 Usage Examples

1. Create a User (MySQL)

import { User } from './models/userModel.js';
import bcrypt from 'bcrypt';

const hashed = await bcrypt.hash('mypassword', 10);
await User.create({
  name: "Jane Doe",
  email: "[email protected]",
  password: hashed
});

2. Find and Authenticate User

import bcrypt from "bcrypt";
import { User } from "./models/userModel.js";

const user = await User.findOne({ where: { email: "[email protected]" } });
if (user && await bcrypt.compare("mypassword", user.password)) {
  console.log("✅ Login successful!");
} else {
  console.log("❌ Invalid credentials");
}

3. Add a New Route

In routes/index.js:

import { getAllProducts } from "../controllers/productController.js";

// Add after existing routes
router.get("/api/products", getAllProducts);

Then visit → http://localhost:3000/api/products

4. Run as Desktop App

If you chose Electron during setup:

# Development mode (auto-reload)
npm run xian-dev

# Production mode
npm run xianca

# Build distributable packages
npm run dist

→ Creates executable files in dist/ folder for all platforms

💾 Migration System

Run anytime to ensure DB structure is synced:

npm run migrate
  • MySQL: Creates DB (if missing) + drops & recreates tables (sync({ force: true }))
  • MongoDB: Connects + ensures collections exist by inserting/deleting dummy doc

⚠️ Warning: MySQL migration wipes existing data. Use sync() without force in production.

🛠️ Configuration

MySQL Connection (models/db.js)

import { Sequelize } from "sequelize";

export const sequelize = new Sequelize("myApp", "root", "your_password_here", {
  host: "localhost",
  dialect: "mysql",
});

🔐 Update username/password as needed.

MongoDB URI (migrate.js)

const DB_URI = `mongodb://127.0.0.1:27017/myApp`;

🌐 Change host/port if MongoDB runs elsewhere.

Electron Configuration (package.json)

The Electron build is pre-configured with:

  • App ID: com.xianfire.app
  • Output directory: dist/
  • Proper file inclusion/exclusion patterns
  • Multi-platform support

⚙️ Available Scripts

| Command | Description | |--------------------------|--------------------------------------| | npm run xian | Start server with auto-reload (nodemon) | | npm start | Start server (production) | | npm run migrate | Initialize/sync database | | npm run create:model <Name> | Generate Sequelize model | | npm run create:controller <nameController> | Generate Express controller | | npm run xian-dev | 🆕 Run Electron app in development | | npm run xianca | 🆕 Run Electron app (production) | | npm run dist | 🆕 Build distributable packages |

🧩 Extending XianFire

You can easily extend the framework:

  • Add Modelsmodels/YourModel.js
  • Add Controllerscontrollers/yourController.js
  • Add Routes → Import in routes/index.js
  • Add Viewsviews/yourpage.xian
  • Add CSS/JSpublic/ folder
  • Integrate Frontend → Vue, React, Svelte via CDN or build tools
  • Customize Electron → Modify electron/main.js for native features

📌 Important Notes

  • 🔐 Always ensure MySQL or MongoDB service is running before npm run migrate.
  • 🍪 Authentication relies on express-session — configure secret in index.js for production.
  • 🧪 Generated controllers assume RESTful conventions — adjust routes as needed.
  • 🖥️ Electron: The same app runs identically in browser and desktop environments
  • 📦 Distribution: Use npm run dist to create installers for Windows, macOS, and Linux
  • 🧑‍💻 For student projects: Great for demos, capstones, and rapid MVP development

🎓 Learning Path for Students

  1. Generate project → npm create xianfires@latest myProject
  2. Choose CRUD + MySQL + Electron for full-stack + desktop experience
  3. Run npm run migratenpm run xian
  4. Visit http://localhost:3000 → Register a user
  5. Use npm run create:model Booknpm run create:controller bookController
  6. Add routes → Test API endpoints
  7. Customize views → Add Tailwind styling
  8. Test desktop version → npm run xian-dev
  9. Build distributable → npm run dist
  10. Deploy web version to Render/Vercel/Heroku

You're now ready to build blazing-fast web AND desktop apps with XianFire!


🔧 Editor Setup (VS Code)

To enable HTML syntax highlighting for .xian template files in Visual Studio Code, add this configuration to your VS Code settings.json:

✅ Step-by-Step

  1. Open VS Code
  2. Press Ctrl + , (Windows/Linux) or Cmd + , (Mac) to open Settings
  3. Click the "Open Settings (JSON)" icon in the top right (looks like a file with curly braces {})
  4. Add or merge this snippet into your settings.json:
{
  "files.associations": {
    "*.xian": "html"
  }
}
  1. Save the file.

✅ Now all .xian files will be highlighted as HTML — including autocomplete, formatting, and error detection!


🖼️ Example Before & After

| Before (No association) | After (HTML highlighting) | |-------------------------------|--------------------------------| | Plain text, no colors | ✅ Syntax-highlighted HTML | | No tag autocomplete | ✅ <div>, class=, etc. work| | Hard to read | ✅ Easy to develop templates |

"Simplicity is the ultimate sophistication." — Designed for Mindoro State University students to learn, build, and ship without boilerplate headaches.

Now with desktop app superpowers! 🚀

Happy coding!