npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

fiberx-backend-toolkit

v0.0.57

Published

A TypeScript backend toolkit providing shared domain logic, infrastructure helpers, and utilities for FiberX server-side applications and services.

Readme

FiberX Backend Toolkit

A comprehensive TypeScript backend toolkit providing shared domain logic, infrastructure helpers, and utilities for FiberX server-side applications and services.

Overview

The FiberX Backend Toolkit is a centralized library designed to streamline backend development across FiberX services. It provides database abstraction layers, migration management, utilities for common operations, and TypeScript type definitions for consistency across the ecosystem.

Features

  • Database Management: Multi-connector support with Sequelize integration for ORM operations
  • Schema Migration System: Automated schema management, migration generation, and execution
  • Seeding Support: Database seeder generation and execution tools
  • Utility Functions:
    • Input validation and transformation
    • Environment variable management
    • SQL formatting and query building
    • Structured logging with file persistence
  • TypeScript Support: Fully typed exports for schema, migration, and utility types
  • Flexible Exports: Modular exports for utils, types, and database modules

Installation

npm install fiberx-backend-toolkit

Requirements

  • Node.js 20.x or higher
  • npm or yarn package manager

Quick Start

Import Types

import type { SchemaInterface, MigrationInterface } from "fiberx-backend-toolkit/types";

Import Utilities

import { LoggerUtil, InputValidatorUtil, EnvManagerUtil } from "fiberx-backend-toolkit/utils";

// Initialize logger
const logger = new LoggerUtil("my-module");
logger.info("Application started");

// Use environment manager
const apiKey = EnvManagerUtil.get("API_KEY");

Database Operations

import { SequelizeConnector, MigrationRunnerScript } from "fiberx-backend-toolkit/database";

// Initialize database connector
const connector = new SequelizeConnector(config);

// Run migrations
const migrationRunner = new MigrationRunnerScript(connector);
await migrationRunner.run();

Core Modules

Utilities (/src/utils)

  • LoggerUtil: Structured logging with file-based persistence
  • InputValidatorUtil: Input validation and sanitization
  • InputTransformerUtil: Data transformation utilities
  • EnvManagerUtil: Environment variable management and parsing
  • SqlFormatterUtil: SQL query formatting and beautification

Database (/src/database)

Connectors

  • BaseConnector: Abstract base class for database connections
  • SequelizeConnector: Sequelize ORM connector implementation

Schema Utilities

  • SchemaDiffUtil: Compare database schemas and detect changes
  • SchemaNormalizerUtil: Normalize schema definitions for consistency

Scripts

  • CreateSchemaScript: Generate initial database schema
  • MakeMigrationsScript: Auto-generate migration files from schema changes
  • MigrationRunnerScript: Execute pending database migrations
  • CreateSeederScript: Generate seeder files for initial data
  • SeederRunnerScript: Execute database seeders

Types (/src/types)

  • SchemaInterface: Database schema type definitions
  • MigrationInterface: Migration type definitions
  • UtilInterface: Utility function types

Module Exports

The toolkit provides structured exports for easy integration:

// Main exports (all modules)
import * as toolkit from "fiberx-backend-toolkit";

// Utils only
import { LoggerUtil, InputValidatorUtil } from "fiberx-backend-toolkit/utils";

// Database only
import { SequelizeConnector, MigrationRunnerScript } from "fiberx-backend-toolkit/database";

// Types only
import type { SchemaInterface } from "fiberx-backend-toolkit/types";

Configuration

The toolkit uses standardized directory conventions:

project_root/
├── logs/                              # Log files directory
├── environment_variables/             # Environment variable files
├── src/database/
│   ├── schemas/                      # Schema definitions
│   ├── schema_snapshots/             # Schema snapshots for comparison
│   ├── models/                       # Sequelize models
│   ├── migrations/                   # Database migrations
│   └── seeders/                      # Database seeders

Dependencies

Core Dependencies

  • sequelize: ^6.37.7 - SQL ORM
  • sequelize-typescript: ^2.1.6 - TypeScript decorators for Sequelize
  • axios: ^1.11.0 - HTTP client
  • bcrypt: ^6.0.0 - Password hashing
  • jsonwebtoken: ^9.0.2 - JWT handling
  • dayjs: ^1.11.18 - Date/time utilities
  • js-yaml: ^4.1.0 - YAML parsing
  • uuid: ^12.0.0 - UUID generation

Build

npm run build

The build process uses tsup for optimized TypeScript bundling.

API Documentation

LoggerUtil

const logger = new LoggerUtil("module-name");

logger.info("Information message");
logger.warn("Warning message");
logger.error("Error message");
logger.debug("Debug message");

Logs are stored locally in the configured LOG_DIR.

InputValidatorUtil

Validates and sanitizes user inputs with built-in rules and custom validators.

EnvManagerUtil

const dbHost = EnvManagerUtil.get("DB_HOST", "localhost");
const dbPort = EnvManagerUtil.getAsNumber("DB_PORT", 5432);

SequelizeConnector

Provides abstraction over Sequelize for database operations with connection pooling and query management.

Project Structure

fiberx-backend-toolkit/
├── src/
│   ├── code_templates/         # Code generation templates
│   ├── config/                 # Configuration constants
│   ├── database/               # Database module
│   ├── types/                  # TypeScript type definitions
│   ├── utils/                  # Utility functions
│   └── index.ts                # Main entry point
├── package.json
├── tsconfig.json
├── tsup.config.ts              # Build configuration
└── README.md

License

ISC

Author

David Matt-Ojo

Repository

GitHub - fiberx-backend-toolkit

Support

For issues, bugs, or feature requests, please visit the issues page.