@hareesh108/unify-js
v1.0.1
Published
Minimalist testing framework for JavaScript
Downloads
15
Maintainers
Readme
🛠️ Unify-JS — Minimal JavaScript Type Checker
Unify-JS is a lightweight, experimental type checker for JavaScript that catches type mismatches before runtime 🚀. It works directly with plain JS code — no TypeScript setup required.
✨ Features
- 🔍 Detects type mismatches in variables, function calls, and expressions
- 🧠 Supports polymorphic functions (adaptable to multiple types)
- 📦 Zero configuration — install and run
- 💡 Clear CLI output for faster debugging
📦 Installation
npm install --save-dev @hareesh108/unify-js⚡ Quick Start
- Create your program:
// myProgram.js
const double = (x) => { return x + x; };
const num = 5;
const str = "hello";
const doubledNum = double(num);
const mixed = double(num) + double(str); // ❌ Type error- Add to
package.json:
{
"scripts": {
"typecheck": "unify-js myProgram.js"
}
}- Run:
npm run typecheck🖥 Example Output
❌ Type mismatch in binary operation: cannot add Number to String🧪 More Examples
✅ No type errors:
const identity = (x) => { return x; };
const result = identity(42);❌ Type mismatch:
const add1 = (x) => { return x + 1; };
const res = add1("hello"); // Error🛠 How It Works

- compile → Parses JavaScript into an AST
- typeCheck → Infers and validates types
- nameCheck → Checks naming and scope rules
📋 Roadmap
- 🌐 Enhanced CLI output with code highlighting
- 🧩 Plugin system for custom rules
- 🖍 VS Code integration
📜 License
MIT © 2025 Hareesh Bhittam
