0.0.7 • Published 3 months ago

skillfolio-common-library v0.0.7

Weekly downloads
-
License
UNLICENSED
Repository
-
Last release
3 months ago

Skillfolio Common Service

The skillfolio-common-service is a shared library designed to provide common functionalities across the Skillfolio platform. This library aims to streamline development by offering reusable services and utilities, starting with an enhanced Logger Service and planning to include more services in the future.

Features

  • Logger Service: A sophisticated logging service integrated with Elasticsearch, offering dynamic index prefix configuration for better log management and organization.
  • Future Services: The architecture is designed to easily incorporate and export additional common services as the platform evolves.

Getting Started

Installation

To use skillfolio-common-library in your project, install it via npm:

npm install skillfolio-common-library


## How to use the Logger Service
import { LoggerService, LoggerConfig } from 'skillfolio-common-library';

const loggerConfig: LoggerConfig = {
  elasticsearchNode: 'http://localhost:9200',
  elasticsearchUsername: 'your_username',
  elasticsearchPassword: 'your_password',
  indexPrefix: 'your_index_prefix',
};

const loggerService = new LoggerService(loggerConfig);

loggerService.log('This is an info log');
loggerService.error('This is an error log');