lib-commons-js is a TypeScript-based Node.js library developed by Lerian Studio. It brings together common building blocks from our , making them reusable across different applications in a JavaScript environment.
It works in both frontend and Node.js backend projects. The goal is to help you write less boilerplate, keep things consistent, and reuse what already works — all in a modular way.
Whether you’re building a plugin, a service, or a UI integration, this library helps you move faster and avoid surprises along the way.
When to Use
Uselib-commons-js whenever you need shared logic that’s been tested across Lerian’s ecosystem. It’s especially useful when you want to:
- Integrate with Midaz.
- Share data models across services.
- Reduce boilerplate in TypeScript projects.
Key Features
- Modular architecture: Import only the components you need to keep your project clean and focused.
- TypeScript support: Written in TypeScript from the ground up for a better developer experience and type safety.
- Core utilities: Ready-to-use helpers for logging, context handling, error management, and transaction processing.
- Shared models: Centralized data models that ensure consistency across projects.
- Business logic: Common rules and patterns used by multiple Midaz services, wrapped and ready to use.
Repository Structure
The repository is organized for clarity and modular usage:
commons/: Core modules and utilities.- Configuration files: Includes
.eslintrc.js,.prettierrc, andtsconfig.jsonto enforce code quality. - Package management: Managed via
package.jsonandpackage-lock.json. - Continuous integration: Automated releases set up with
.github/workflows and.releaserc.yml.
Getting Started
Requirements
You’ll need Node.js v23 or later to use this library.1. Install the Library
2. Add the Library to Your Project
To uselib-commons-js, import the relevant subpackage in the file where you need it. The functions will be available through the named import:
Contributing
We welcome contributions. If you’ve written logic that could benefit other services, let’s bring it into
lib-commons-js.
Make sure your code follows our standards and includes test coverage.
License
- Apache 2.0 - refer to the LICENSE page for details.

