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

@sky_bohra/common-services

v0.0.3

Published

Reusable common services library for NestJS microservices

Readme

📋 Overview

A comprehensive NestJS library providing production-ready services for:

  • 🔐 Encryption/Decryption - Secure data encryption with configurable keys
  • 📝 Logging - Structured logging with Winston integration
  • 📤 Response Handling - Standardized API response format
  • ⚠️ Exception Management - Global exception filtering and custom exceptions
  • 🎯 Decorators - Useful decorators for common operations

🚀 Installation

npm install @skybohra/common-services

📖 Documentation

For detailed usage instructions, API references, and examples, please refer to the Wiki.

🔧 Configuration

Common Services Library can be easily configured to suit your application's needs. Here's a basic example:

import { Module } from '@nestjs/common';
import { CommonServicesModule } from '@skybohra/common-services';

@Module({
  imports: [
    CommonServicesModule.forRoot({
      encryptionKey: 'your-encryption-key',
      logLevel: 'debug',
    }),
  ],
})
export class AppModule {}

🎉 Features

  • EncryptionService: Encrypt and decrypt data using AES-256-CBC.
  • LoggingService: Log messages with different severity levels (debug, info, warn, error).
  • ResponseService: Send standardized JSON responses with success and error formats.
  • ExceptionFilter: Global exception filter to catch and handle exceptions.
  • Custom Decorators: @Encrypt(), @Log(), @Response(), and @Exception() decorators for easy usage.

🚦 Usage

Here's a quick example demonstrating the usage of some features:

import { Controller, Get, UseFilters } from '@nestjs/common';
import { AppService } from './app.service';
import { ResponseService, LoggingService, ExceptionFilter } from '@skybohra/common-services';

@Controller()
@UseFilters(ExceptionFilter)
export class AppController {
  constructor(
    private readonly appService: AppService,
    private readonly responseService: ResponseService,
    private readonly loggingService: LoggingService,
  ) {}

  @Get()
  getHello(): string {
    this.loggingService.log('Fetching hello world message');
    return this.responseService.success({ message: this.appService.getHello() });
  }
}

🧪 Testing

Common Services Library comes with built-in support for testing. Here's an example of a unit test for the EncryptionService:

import { Test, TestingModule } from '@nestjs/testing';
import { EncryptionService } from './encryption.service';

describe('EncryptionService', () => {
  let service: EncryptionService;

  beforeEach(async () => {
    const module: TestingModule = await Test.createTestingModule({
      providers: [EncryptionService],
    }).compile();

    service = module.get<EncryptionService>(EncryptionService);
  });

  it('should encrypt and decrypt data', () => {
    const data = 'Hello World';
    const encryptedData = service.encrypt(data);
    const decryptedData = service.decrypt(encryptedData);

    expect(decryptedData).toEqual(data);
  });
});

🤝 Contributing

We welcome contributions to Common Services Library! Please read our Contributing Guide for details on how to contribute.

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

📞 Support

For support, please open an issue on the GitHub repository or contact the maintainer.


This README was generated with ❤️ by NestJS CLI