Skip to content

mykopk/config

Repository files navigation

@myko.pk/config

Constants you can count on.

Shared configuration constants for the MYKO ecosystem — database pool defaults, well-known numeric constants, and cross-service configuration values.

npm version npm downloads build stars forks issues last commit license

📑 Table of Contents

📝 Description

@myko.pk/config provides shared configuration constants used across every MYKO backend service. Instead of hard-coding database pool sizes, timeouts, or magic numbers in each service, this package centralises them into well-named, well-documented exports. It includes the dynamicPoolDefaultConfig for PostgreSQL connection pooling and the NUMERIX set of standardised numeric constants (timeouts, limits, defaults) that keep every service aligned.

✨ Key Features

  • 🔢 Centralised Numeric ConstantsNUMERIX.THIRTY_THOUSAND, NUMERIX.TEN, and more — consistent across all services.
  • 🗄️ Database Pool DefaultsdynamicPoolDefaultConfig with sensible min/max/acquire/idle values for PostgreSQL.
  • 📘 Fully Typed — Every constant is exported with its TypeScript type.
  • ⚡ Zero Dependencies — Pure constants with no runtime deps.

🎯 Use Cases

  • Sharing dynamicPoolDefaultConfig across all services that connect to PostgreSQL so every pg.Pool uses the same defaults.
  • Replacing magic numbers like 30000 with NUMERIX.THIRTY_THOUSAND for self-documenting, consistent code.
  • Importing standardised timeout, retry, and pagination limits in every MYKO package.

🛠️ Tech Stack

  • 📘 TypeScript

Notable libraries: None — pure constants, zero runtime deps.

⚡ Quick Start

npm install @myko.pk/config
import { dynamicPoolDefaultConfig } from '@myko.pk/config';
import { NUMERIX } from '@myko.pk/config/db';

const pool = new Pool(dynamicPoolDefaultConfig);
const timeout = NUMERIX.THIRTY_THOUSAND; // 30000

🚀 Available Scripts

  • buildnpm run build
  • typechecknpm run typecheck

📁 Project Structure

.
├── CHANGELOG.md
├── CONTRIBUTING.md
├── LICENSE
├── SECURITY.md
├── package.json
├── src
│   ├── db
│   │   ├── index.ts
│   │   └── numerix.config.ts
│   └── index.ts
├── tsconfig.json
└── tsup.config.mjs

🛠️ Development Setup

  1. Install Node.js (v18+ recommended)
  2. Install dependencies: npm install
  3. Build: npm run build

🧪 Testing

This project currently exports pure constants — no runtime tests required.

👥 Contributors

arsalanwahab

See the full list of contributors →

👥 Contributing

Contributions are welcome! Here's the standard flow:

  1. Fork the repository
  2. Clone your fork: git clone https://github.com/mykopk/config.git
  3. Branch: git checkout -b feature/your-feature
  4. Commit: git commit -m 'feat: add some feature'
  5. Push: git push origin feature/your-feature
  6. Open a pull request

Please follow the existing code style and include types for new behavior where applicable.

📜 License

This project is licensed under the MIT License.

MYKO Pakistan

Detail Information Website myko.pk Email support@myko.pk About Building digital infrastructure and super-app experiences for millions of users across Pakistan. Built with ❤️ in Pakistan 🇵🇰

About

Shared configuration constants for @myko.pk packages

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors