Socket
Book a DemoInstallSign in
Socket

xtra-logger

Package Overview
Dependencies
Maintainers
0
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xtra-logger

A lightweight logger, console text coloriser and text formatter with highest formatting options.

1.0.1
latest
Source
npmnpm
Version published
Maintainers
0
Created
Source
xtra-logger logo

XTRA-LOGGER

A lightweight logger, console text coloriser and text formatter with highest formatting options written in Typescript


Compatibility:

VersionCompatibility
Es5 Javascript
Es6 Javascript
Typescript

Features:

FeatureAvailability
Logging
Text Formatting
Console Colorize
Combined Formatting
Size
17 kb

Installation:

Node Package Manager (NPM)

npm i xtra-logger

Yet Another Resource Navigator (YARN)

yarn add xtra-logger

Importing:

For Es5 Js

const { logger, format } = require("xtra-logger");

For Es6 Js / Typescript

import { logger, format } from "xtra-logger";

Usage Examples:

Logging features:

  • 5 Log methods available ( info, warn, success, warn, error )
  • Changable timezome for Docker / Remote servers ( Search your time zome name from here. )
  • Log format : [ DD.MM.YY - HH:MM:SS ] - [ TYPE ] - MESSAGE

Example :

import { logger, format } from "xtra-logger";

// Changing the timezone of logger [ optional ] (By default it will use system time)
logger.timeZone("Asia/Kolkata");

// Logging options
logger.info("Starting the server...");
logger.warn("Using node v:18.6");
logger.success("Server started successfully.");
logger.debug("NPM update available.");
logger.error("An error occurd in the server.");

Output :

Formatting example output

Text formatting features:

  • 50+ text formatting / colorizing options available.
  • Multiple formatting can be combined together to create new style.

Example :

import { logger, format } from "xtra-logger";

// Only bold text
console.log(format.bold("This is a Bold text\n"));

// Combining colours + multiple formatting
console.log(
  format.bold(
    format.italic(format.cyan("This is a Bold + Italic + Cyan colour text \n"))
  )
);

console.log(
  format.bgBrightmagenta(
    format.strikethrough(
      format.lightwhite(
        "This is a strikethrough + light white text with bright magenta background"
      )
    )
  )
);

Output :

Formatting example output

Contributing:

I don't have any contributors in this project yet. Feel free to contribute and making it better.



Keywords

logger

FAQs

Package last updated on 13 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.