QuickModelThe Complete TypeScript Modeling Kit
30+ type transformers, two-layer validation, mocks, 7 schema formats, and a built-in MCP server for AI — all driven by a single `@Quick` decorator.
30+ type transformers, two-layer validation, mocks, 7 schema formats, and a built-in MCP server for AI — all driven by a single `@Quick` decorator.
Works with the tools you already use
QuickModel is more than a serialization library — it is a complete development platform for data-intensive TypeScript applications.
Date, BigInt, Set, Map, RegExp, Symbol, Error, WeakMap, WeakSet, ArrayBuffer, TypedArray, URL… Each type has its own specialized transformer.[Date], [[Post]], [[[Map]]] for 1D, 2D or 3D.@Quick: class-level decorator that configures all transformers at once.@QType: property-level decorator for specific cases or different contexts.@QAlias: renames fields between incoming JSON and the instance. Perfect for snake_case ↔ camelCase.@QComputed: defines getters that appear in serialize() without existing in the original JSON.excludeFields: permanently excludes fields from all serialization (password, _checksum, etc.).checkIntegrity() verifies each value matches its transformer (invalid dates, BigInt out of range, dangerous RegExp).@QRule applies declarative predicates per field. checkRules() returns errors with field and message.isValid() runs both layers in a single call. validationReport() separates errors by origin.@QField, @QRule and @QGroup don't require extending QModel. Useful for DTOs, Angular/Vue/React forms…qCheckRulesByGroup() validates only the active group, perfect for multi-step forms.qCheckRulesAsync() supports predicates returning Promise<boolean> with timeoutMs and serial/parallel mode.A single getSchema(format) call exports your model as:
json · zod · openapi · mongo · typescript · graphql · ajv
Documentation, validation, and API contracts always in sync with your code.
QuickModel includes 20 tools and 20 guided prompts: create_model, interface_to_model, get_model_schema, generate_mock, simulate_validation, diff_models, roundtrip…
User.mock().random() → valid, typed object with realistic data.User.mock().array(5) → array of 5 instances.User.mock().random({ name: 'Alice' }) → object with overridden fields.@faker-js/faker. Perfect for building UI before the API exists.APIs return different shapes in the same list (Payment → Card or PayPal). QuickModel instantiates the correct subclass automatically from the data shape. No switch, no factories.
{ __circular: true } in the output.javascript:) and limits RegExp length.__proto__ properties automatically excluded.unknownPropertyPolicy: 'error' throws on unexpected properties in public APIs.QModel.extends(BaseClass): adds superpowers to TypeORM entities, NestJS DTOs, or any class without touching the hierarchy.experimentalDecorators (TS 3.4+) and TC39 standard (TS 5+).declare, ! and ? all work identically.QuickModel vs other libraries with similar features
⚠️ = available with extra manual code
| Feature | QuickModel | arktype | class-transformer | class-validator | faker (manual) | Immer | joi | superjson | TypeBox | valibot | vest | yup | Zod | Plain JS |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Async business rules (@QRule) | ✅ | ❌ | ❌ | ⚠️ | ❌ | ❌ | ⚠️ | ❌ | ❌ | ❌ | ⚠️ | ⚠️ | ⚠️ | ❌ |
| Auto coercion | ✅ | ❌ | ⚠️ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ⚠️ | ❌ | ❌ | ⚠️ | ❌ |
| Built-in AI / MCP Server | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| Compile-time TS inference | ✅ | ✅ | ❌ | ❌ | ❌ | ⚠️ | ❌ | ❌ | ✅ | ✅ | ❌ | ❌ | ✅ | ❌ |
| Computed fields (@QComputed) | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| copy() / isDirty() | ✅ | ❌ | ❌ | ❌ | ❌ | ⚠️ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| Decorator constraints (@IsEmail…) | ✅ | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| Form schemas (@QField) | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ⚠️ | ❌ | ❌ | ❌ |
| Multi-level inheritance inference | ✅ | ❌ | ⚠️ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| Native serialization (toJSON) | ✅ | ❌ | ⚠️ | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| Polymorphic JSON | ✅ | ❌ | ⚠️ | ❌ | ❌ | ❌ | ❌ | ⚠️ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| Preserves RegExp/undefined/NaN | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| Runtime integrity | ✅ | ✅ | ❌ | ⚠️ | ❌ | ❌ | ⚠️ | ❌ | ✅ | ⚠️ | ⚠️ | ⚠️ | ✅ | ❌ |
| Schema export (JSON/Zod/OpenAPI) | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
| Tree-shakeable | ✅ | ✅ | ❌ | ❌ | ✅ | ✅ | ❌ | ❌ | ⚠️ | ✅ | ❌ | ❌ | ❌ | ❌ |
| Typed mock generation | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| Validation groups / suites | ✅ | ❌ | ❌ | ⚠️ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ |
A single decorator transforms JSON strings into BigInt, Date, Map and more
import { QModel, Quick } from 'quickmodel';
interface IUser {
name: string;
balance: bigint;
lastLogin: Date;
roles: Set;
}
@Quick({
balance: 'bigint', // primitive alias
lastLogin: Date, // native constructor
roles: Set, // complex collection
})
class User extends QModel {
declare name: string;
declare balance: bigint;
declare lastLogin: Date;
declare roles: Set;
}
const user = new User({
name: 'Alice',
balance: '500000000000000000', // string → BigInt auto-coerced
lastLogin: '2024-03-15T10:00:00Z', // string → Date auto-coerced
roles: ['admin', 'editor'], // array → Set auto-coerced
});
console.log(user.balance + 1n); // 500000000000000001n
console.log(user.lastLogin.getFullYear()); // 2024
console.log(user.roles.has('admin')); // true