Utilities

Collection of generic TypeScript utilities, reusable ESLint configurations, and robust Server helpers.

Shared Utilities

The Utilities package (@riavzon/utils) is a tree-shakeable library containing cross-platform helper functions for data manipulation, strict typings, ESLint setups, and server operations.

Installation

If you are using this outside the monorepo, install via your preferred package manager:

pnpm add @riavzon/utils

Core Features

The utilities are split into four main modules:

Generic Utilities
Core helper functions for array, object, promise, and string manipulation. Available for both client and server.
Server Utilities
Node.js-only helpers for path resolution, shell command execution, and CSV bulk uploads to MySQL and PostgreSQL.
ESLint Configs
Pre-configured, ultra-strict ESLint setups for pure TypeScript and Vue projects to maintain a clean codebase.
Utility Types
Advanced TypeScript utility types for better safety, nominal grouping, and IDE tooltip refinement.

Quick Example

Here is a brief look at how you can interact with the different modules available in the package:

import { ensureArray, cleanObject } from '@riavzon/utils'

// Ensures the provided value is an array
const items = ensureArray(undefined) // []

// Removes null/undefined values from objects
const filtered = cleanObject({ name: 'Example', empty: null }) // { name: 'Example' }
Logo