DEV Community

Cover image for Introducing Codetrix: A Mordern Utility Library for Type-safe Javascript & Typescript
shivanshuJags
shivanshuJags

Posted on

Introducing Codetrix: A Mordern Utility Library for Type-safe Javascript & Typescript

Hi devs! πŸ‘‹

After weeks of building and refining, I’m excited to introduce my new npm package: codetrix β€” a modern, modular utility library built for cleaner, safer, and type-friendly JavaScript/TypeScript codebases.

What is codetrix?

codetrix is a lightweight utility library that provides essential helper functions for:

  1. Numbers (e.g., clamp, randomInt, roundTo)

  2. Arrays (e.g., unique, chunk, compact)

  3. Dates (e.g., isToday, formatDate, daysBetween)

  4. Strings (e.g., truncate, camelCase, capitalize)

  5. Objects (e.g., deepClone, getNested, isEmpty)

  6. Validations (coming soon)

Think of it as your personal Lodash, but with full TypeScript support and a modern modular structure.

Why I Built It

While working on multiple frontend and full-stack projects, I often found myself:

  1. Rewriting the same utility functions over and over

  2. Importing huge libraries (like Lodash) when I only needed 2–3 methods

  3. Wanting typed safety and tree-shakable modules

So I built codetrix to solve those problems, and now I want to share it with the community.

Installation

npm install codetrix
// or
yarn add codetrix
Enter fullscreen mode Exit fullscreen mode

Features

Fully written in TypeScript

  1. Modular imports (e.g., codetrix/number)

  2. Lightweight and tree-shakable

  3. Growing function set (more coming!)

Looking for Feedback & Contributors

I'm actively improving the library and open to:

  1. Feature requests

  2. Bug reports

  3. Contributions

Npm Codetrix
Documentation
Git Repo

Top comments (0)