
Welcome to Rule Engine JS
Stop hardcoding business logic. Rule Engine JS lets you define complex conditional logic as data, making your applications more flexible, maintainable, and business-friendly.Key Features
Zero Dependencies
Lightweight with no external dependencies for minimal bundle size
High Performance
Intelligent caching with LRU eviction for optimal speed
Security First
Built-in protection against prototype pollution and malicious access
Type Safe
Full TypeScript support with comprehensive type definitions
Stateful Engine
Track state changes with event-driven architecture
Extensible
Easy custom operator registration for business-specific logic
Dynamic Fields
Compare values across different data paths
Monitoring
Built-in performance metrics and cache statistics
Why Choose Rule Engine JS?
Flexible Business Logic
Flexible Business Logic
Define business rules as JSON data instead of hardcoding them. Update rules without deploying code changes.
Developer-Friendly API
Developer-Friendly API
Fluent helper API makes building complex rules intuitive and readable.
Production-Ready
Production-Ready
Battle-tested with 500+ unit tests and >90% code coverage. Zero dependencies means fewer security
vulnerabilities.
Framework Agnostic
Framework Agnostic
Works with any JavaScript framework - React, Vue, Angular, Node.js, Express, and more.
Installation
Quick Example
Here’s a simple example to get you started:Core Principles
1
Rules are Data
Rules are simple JSON objects that describe conditions, making them easy to store, version, and manage.
2
Declarative Syntax
Express complex logic in a readable, maintainable format using helper functions or raw JSON.
3
Safe by Default
Security features protect against common vulnerabilities like prototype pollution and malicious
data access.
4
Performance Optimized
Intelligent caching and optimized evaluation paths ensure fast rule execution even with complex logic.
What’s Next?
Quick Start
Get up and running in 5 minutes with our quickstart guide
Core Concepts
Learn about the engine architecture and key concepts
Operators Reference
Explore all available operators and their usage
Examples
See real-world examples and use cases

