Welcome to Open Kerno Commons
· One min read
We are happy to introduce @open-kerno/commons — a shared TypeScript utility library for Node.js services.
What is it?
@open-kerno/commons is a collection of well-tested, typed modules designed to solve common problems across backend services. Instead of copying the same utilities from project to project, you can install this package and start using them right away.
What is included?
- HTTP —
HttpStatusCodeandHttpMethodenums covering all standard codes and methods. - Errors — Typed error classes (
ServerError,BadRequestError,InternalServerError,DatabaseConnectionError) with HTTP status codes and optional error payloads. - Collections —
createMapFromArrayandcreateSetFromArrayfor fast lookups. - Math —
proratefor proportional distribution androundWithPrecisionfor accurate rounding. - Logger — A structured logger with field masking, built on Winston.
- Infrastructure — A PostgreSQL connection pool wrapper with session and transaction helpers.
- Object —
encodeJSONfor safe JSON parsing with typed fallbacks.
Getting started
npm install @open-kerno/commons
Check the documentation for the full API reference.