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

mosu-be-framework

v0.0.5

Published

Mosu backend framework that exposes enums and types.

Downloads

16

Readme

Mosu Backend Framework

A modern, modular backend framework built on NestJS for scalable microservices architecture. This framework provides standardized modules for common backend functionality including messaging, caching, and database operations.

Introduction

The Mosu Backend Framework is designed to accelerate development of microservices by providing pre-built, configurable modules for common backend requirements. The framework has recently undergone significant updates:

  • Messaging: Kafka for more scalable and resilient message processing
  • Caching: Dragonfly for improved performance and memory efficiency
  • Analytics: ClickHouse for high-performance data analytics and time-series storage

Each module follows a consistent pattern with async configuration options, making them easy to integrate into any NestJS application.

Bucket Module

Module Registration

import { BucketModule } from '@mosu/be-framework';

@Module({
  imports: [
    BucketModule.forRootAsync({
        imports: [AppConfigModule],
        inject: [AppConfigService],
        useFactory: (config: AppConfigService) => ({
            provider: 'minio',
            endpoint: config.bucketEndpoint,
            cdnEndpoint: bucketCdnEndpoint,
            key: config.bucketKey,
            secret: config.bucketSecret,
            defaultConf: {
                defaultBucket: config.bucketDefaultBucket,
                defaultPrefix: config.bucketDefaultPrefix,
            },
            env: config.env,
        }),
    }),
 ]
})
export class AppModule {}

Available Methods

  • getSignedUrl(key: string, options: SignedUrlOptions): Promise<string>
  • getSignedPutUrl(key: string, options: SignedUrlOptions): Promise<string>
  • upload(key: string, content: string | Buffer, options: UploadOptions): Promise<string>
  • delete(key: string, options: SignedUrlOptions): Promise<string>
  • buildUrl(key: string): string

Dragonfly Cache Module

Module Registration

import { DragonflyModule } from '@mosu/be-framework';

@Module({
  imports: [
    DragonflyModule.forRootAsync({
        imports: [AppConfigModule],
        inject: [AppConfigService],
        useFactory: (config: AppConfigService) => ({
            url: config.redisUrl, // Works with both Redis and Dragonfly servers
            ttl: 5 * 60 * 1000, // 5 minutes
            maxReconnectAttempts: 5,
            reconnectDelay: 5000, // 5 seconds
            pingInterval: 5000, // 5 seconds
            crashOnConnectFailure: true,
        }),
    }),
  ],
})
export class AppModule {}

Available Methods

  • get<T>(key: string): Promise<T | undefined>
  • set<T>(key: string, value: T, ttl?: number): Promise<void>
  • del(key: string): Promise<void>
  • reset(): Promise<void>
  • wrap<T>(key: string, fn: () => Promise<T>, ttl?: number): Promise<T>
  • mset<T>(keyValuePairs: Array<[string, T]>, ttl?: number): Promise<void>
  • mget<T>(keys: string[]): Promise<(T | null)[]>
  • exists(key: string): Promise<boolean>

Location Module

Module Registration

import { LocationModule } from '@mosu/be-framework';

@Module({
  imports: [
    LocationModule.forRootAsync({
        imports: [AppConfigModule],
        inject: [AppConfigService],
        useFactory: (config: AppConfigService) => ({
            apiKey: config.apiKey,
        }),
    }),
 ]
})
export class AppModule {}

Available Methods

  • validateAddress(address: string): Promise<AddressValidationOutput>
  • autocompleteAddress(payload: AddressAutocompleteInput): Promise<AddressValidationOutput[]>

Kafka Module

Module Registration

import { KafkaModule } from '@mosu/be-framework';

@Module({
  imports: [
    KafkaModule.forRootAsync({
        imports: [AppConfigModule],
        inject: [AppConfigService],
        useFactory: (config: AppConfigService) => ({
            clientId: 'my-app',
            brokers: config.kafkaBrokers,
            ssl: config.kafkaUseSsl,
            topics: [
              { name: 'user-events', numPartitions: 3, replicationFactor: 2 },
            ],
            consumerGroups: [
              { groupId: 'user-events-group', topics: ['user-events'] },
            ],
        }),
    }),
  ]
})
export class AppModule {}

Available Methods

  • createProducer(config?: ProducerConfig): Promise<void>
  • createTopic(topicConfig: KafkaTopicConfig): Promise<void>
  • publish<T>(topic: string, message: T, key?: string): Promise<void>
  • consume(groupId: string, topics: string[], config?: ConsumerConfig): Promise<ConsumerSubject>
  • subscribeConsumer(consumerGroup: string, topic: string, messageKey?: string): Promise<ConsumerSubject>
  • checkHealth(): Promise<KafkaHealthStatus>

ClickHouse Module

Module Registration

import { ClickHouseModule } from '@mosu/be-framework';

@Module({
  imports: [
    ClickHouseModule.forRootAsync({
        imports: [AppConfigModule],
        inject: [AppConfigService],
        useFactory: (config: AppConfigService) => ({
            host: config.clickhouseHost,
            port: config.clickhousePort,
            username: config.clickhouseUsername,
            password: config.clickhousePassword,
            database: config.clickhouseDatabase,
        }),
    }),
  ]
})
export class AppModule {}

Available Methods

  • query<T>(sql: string, params?: Record<string, any>): Promise<T[]>
  • insert<T>(table: string, data: T | T[]): Promise<void>
  • createTable(tableName: string, schema: Record<string, string>): Promise<void>
  • checkHealth(): Promise<{ status: 'ok' | 'error', details?: string }>