8000 GitHub - davidplpz/fflag-lib: Librería modular y extensible para gestionar feature flags utilizando Redis como almacenamiento. Basada en principios de Domain-Driven Design (DDD) y Arquitectura Hexagonal.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Librería modular y extensible para gestionar feature flags utilizando Redis como almacenamiento. Basada en principios de Domain-Driven Design (DDD) y Arquitectura Hexagonal.

Notifications You must be signed in to change notification settings

davidplpz/fflag-lib

Repository files navigation

🧩 fflags-lib

Modular and extensible library for managing feature flags using Redis as storage. Based on Domain-Driven Design (DDD) principles and Hexagonal Architecture.


🚀 Features

  • ✅ Feature flag management: activate, deactivate, create, delete, retrieve.
  • 🧱 Hexagonal architecture (ports and adapters).
  • 🧠 Clear separation between domain, application, and infrastructure.
  • 🔌 Redis storage (can be extended to others).
  • 📦 Packaged as a library for reuse in multiple projects.
  • 🧪 Tested with Vitest.
  • ⚙️ Written in TypeScript and compatible with ESM/CJS.

📦 Installation

npm install fflags-lib

🧑‍💻 Basic usage

  1. Use the use cases
import { Redis } from 'ioredis';
import { ManagerService } from "fflags-lib";

const redis = new Redis();
const managerService = ManagerService.getInstance(redis)

let flag = await managerService.createFlag('test', true, 'test flag')
flag = await managerService.getFlag('test')
flag = await managerService.deactivateFlag('test')
flag = await managerService.activateFlag('test')
flag = await managerService.deleteFlag('test')
flag = await managerService.getAllFlags()
flag = await managerService.getActivatedFlags()
flag = await managerService.getInactiveFlags()

🧪 Tests

npm run test

⚙️ Configuration

To use with your own paths or tools, check:
•	tsconfig.json with configured baseUrl and paths.
•	tsup.config.ts for bundling.
•	vitest.config.ts for tests.

📌 Requirements

  • Node.js 18+
  • Redis 6+
  • ioredis 5+

About

Librería modular y extensible para gestionar feature flags utilizando Redis como almacenamiento. Basada en principios de Domain-Driven Design (DDD) y Arquitectura Hexagonal.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  
0