Cretex
Cretex logo

Welcome to Cretex

Cretex is a powerful and flexible utility designed to simplify dynamic data management. Whether you're working with API responses, complex serialization, dynamic styles, or structured data merging, Cretex provides an efficient and elegant solution.

Built with performance and scalability in mind, Cretex supports ESM, CJS, and modern JavaScript environments, making it highly versatile for both frontend and backend applications.


Why Cretex?

Modern applications require a highly flexible and efficient way to handle structured data dynamically. Cretex is designed to address these challenges with:

  • Efficient API Response Handling - Combine, clean, and structure API responses seamlessly.
  • Advanced Data Serialization - Process deeply nested objects without complexity.
  • Dynamic String Management - Merge conditional string with ease and more powerful.
  • Smart Object Merging - Preserve important values while ensuring flexibility in updates.
  • Optimized Performance - Built-in cycle detection prevents infinite loops, and optimized processing ensures minimal overhead.
  • Seamless TypeScript Support - Fully typed for enhanced developer experience.

Core Features

ocx - Object Combination with Chaining

Cretex provides a powerful object merging utility with a chaining mechanism for advanced configurations.

function ocx<T extends ocxKey>(...obj: ocxObj<T>[]): ocxAcc<T>;

clean - Deep Cleaning of Objects

Removes falsy values, empty objects, and unnecessary data while maintaining control over exclusions.

function clean<T extends ocxKey>(obj: T, exclude?: unknown[]): T;

cnx - Dynamic String Management

A simplified and powerful alternative to clsx that supports all argument types, including functions.

function cnx(...inputs: cnxValues[]): string;

cvx - Variance Handling Management

A flexible variant handling utility similar to cva, but with a more intuitive syntax.

function cvx<T extends cvxKeys>(keys: cvxRecord<T>): (result?: cvxResult<T>) => string;

Getting Started

To start using Cretex, follow the installation guide and explore the documentation to learn about its powerful features.

pnpm add cretex

For detailed API references and real-world examples, visit the Documentation.


Built for Modern Development

Cretex is compiled with ES2020, ESNext, and DOM support, making it suitable for modern JavaScript and TypeScript applications. It works seamlessly in:

  • Node.js (CJS & ESM support)
  • Browser environments (via CDN or bundlers)
  • Deno & Bun
  • Frontend frameworks (React, Vue, Svelte, etc.)
  • Backend APIs (Express, Fastify, Koa, etc.)

Join the Community

Cretex is an open-source project, and we encourage contributions from the community! Join the discussion, contribute to the codebase, or share your feedback:

Together, let's make data management more efficient, clean, and powerful. 🚀