Skip to main content

Introduction

@open-kerno/commons is a shared TypeScript utility library for Node.js applications. It provides a set of well-tested, typed modules that solve common problems across services.

Installation

npm install @open-kerno/commons

Modules

ModuleDescription
httpHttpStatusCode and HttpMethod enums
errors/httpTyped HTTP error classes
errors/databaseTyped database error classes
collectionsArray to Map/Set utilities
math/distributionWeighted value distribution
math/roundingPrecision rounding
loggerStructured logger with field masking
infrastructure/database/postgresPostgreSQL connection pool wrapper
objectJSON encoding helpers
currencyImmutable, fluent money arithmetic

Requirements

  • Node.js 18 or higher
  • TypeScript 5 or higher