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

@alisdev/be-kit

v2.0.3

Published

All-in-one backend utility kit for Node.js + TypeScript

Downloads

454

Readme

@alisdev/be-kit

be-kit is a comprehensive, decorator-driven backend utility toolkit for Node.js and TypeScript applications. It consolidates multiple modular toolkits into a single, cohesive framework, accelerating backend development with elegant, highly readable code.

📦 Included Toolkits

@alisdev/be-kit provides a suite of highly-integrated modules:

  • mongo: Decorator-based MongoDB ODM with robust repository patterns, transactions, and a fluent query builder.
  • router: Express routing engine using decorators, middleware injection, and automatic parameter resolution.
  • mailer: Email rendering and delivery service with template interpolation and queueing support.
  • scheduler: Cron job manager with decorators, dynamic registration, and real-time status monitoring.
  • cache: Caching abstraction layer supporting in-memory and Redis stores with elegant @Cacheable decorators.
  • event: Event-driven architecture with wildcard support, async handlers, and event history tracking.
  • socket: WebSocket (Socket.io) namespace controllers with decorators for rooms, connections, and message validation.

🚀 Installation

Install the core package and its required peer dependencies:

# Using npm
npm install @alisdev/be-kit mongoose reflect-metadata zod

# Using pnpm
pnpm add @alisdev/be-kit mongoose reflect-metadata zod

Depending on the kits you intend to use, you may need to install additional optional peer dependencies:

pnpm add express        # for router-kit
pnpm add socket.io      # for socket-kit
pnpm add nodemailer     # for mailer-kit
pnpm add node-cron      # for scheduler-kit
pnpm add eventemitter2  # for event-kit

Enable Decorators

Ensure your tsconfig.json has decorators enabled:

{
  "compilerOptions": {
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true
  }
}

📖 Quick Start

Here is a full example combining mongo-kit and router-kit to create a complete REST endpoint in minutes:

import "reflect-metadata";
import express from "express";
import mongoose from "mongoose";
import { 
  Schema, BaseEntity, Repository, BaseRepository, 
  ReqController, GetMapping, PostMapping, Body, RouterKit 
} from "@alisdev/be-kit";
import { z } from "zod";

// 1. Define your Database Entity
@Schema({ collection: "users", timestamps: true })
class User extends BaseEntity {
  name: string;
  email: string;
}

// 2. Define your Data Repository
@Repository(User)
class UserRepository extends BaseRepository<User> {}

// 3. Define your REST Controller
const CreateUserSchema = z.object({
  name: z.string(),
  email: z.string().email()
});

@ReqController("/api/users")
class UserController {
  private userRepo = new UserRepository();

  @GetMapping("/")
  async getAllUsers() {
    // Automatically uses BaseRepository's find() method
    return await this.userRepo.find(); 
  }

  @PostMapping("/")
  async createUser(@Body() data: any) {
    const validated = CreateUserSchema.parse(data);
    return await this.userRepo.save(validated);
  }
}

// 4. Bootstrap your Application
async function bootstrap() {
  await mongoose.connect("mongodb://localhost:27017/my_database");

  const app = express();
  app.use(express.json());

  // Register controllers with Express
  RouterKit.register(app, [UserController]);

  app.listen(3000, () => {
    console.log("Server running on http://localhost:3000");
  });
}

bootstrap();

📚 Detailed Documentation

Dive deeper into each module's capabilities:

  • Mongo Kit - Advanced queries, transactions, and Zod integration.
  • Router Kit - Parameter decorators, middleware, and exception handling.
  • Mailer Kit - Template engines and provider adapters.
  • Scheduler Kit - Decorator-based cron jobs and runtime control.
  • Cache Kit - Key interpolation and caching strategies.
  • Event Kit - Wildcard listeners and historical replays.
  • Socket Kit - Namespace routing and room management.

🔄 Migration from v1

If you are migrating from standalone @alisdev packages (e.g., @alisdev/mongo-kit, @alisdev/router-api-kit), update your imports to point to the unified @alisdev/be-kit package.

v1 (Old):

import { Repository } from "@alisdev/mongo-kit";
import { ReqController } from "@alisdev/router-api-kit";

v2 (New):

import { Repository, ReqController } from "@alisdev/be-kit";

License

MIT License.