0.0.5 • Published 6 months ago

logpainter v0.0.5

Weekly downloads
-
License
MIT
Repository
-
Last release
6 months ago

LogPainter 🚀

NPM Version Downloads License TypeScript GitHub stars

logpainter is a lightweight and easy-to-use package for adding stylized console messages and animated loaders in Node.js.

Installation 📦

npm install logpainter

or for development

npm install logpainter --save-dev

Usage 🛠️

consoleStyler – Styled Console Messages 🎨

Use consoleStyler to display formatted messages in the terminal with colors, emojis, and text styles.

import { consoleStyler } from 'logpainter'

consoleStyler('This is a test', {
  color: 'green',
  emojiStart: 'ok_hand',
  bgColor: 'black',
  bold: true,
  emojiEnd: 'ok_hand'
})

Example Output:

Console Data Example


consoleLoader – Animated Terminal Loaders ⏳

Use consoleLoader to display a loading animation while executing an asynchronous task.

import { consoleLoader } from 'logpainter'

consoleLoader(asyncFuntion, {
  message: 'Making a request...',
  color: 'green',
  emojiStart: 'hourglass_not_done',
  bgColor: 'black',
  bold: true,
  emojiEnd: 'hourglass_done',
  loaderName: 'soccer'
})
  .then((res) => {
    const asyncFuntionRes = res
    consoleStyler('Success!', {
      color: 'green',
      emojiStart: 'check_mark_button'
    })
  })
  .catch((err) =>
    consoleStyler('Failed!', {
      color: 'red',
      emojiStart: 'cross_mark'
    })
  )

Example Output:

Console Loader Example


Available Options ⚙️

consoleStyler Options:

OptionTypeDescription
colorstringText color (red, blue, green, etc.).
boldbooleanBold text.
bgColorstringBackground color.
indentnumberSpaces before the text.
emojiStartstringEmoji at the beginning.
emojiEndstringEmoji at the end.
alingstringText alingnment (left, center, right).

consoleLoader Options (extends consoleStyler options)

consoleLoader includes all options from consoleStyler, plus the following:

OptionTypeDescription
messagestringLoading message.
loaderNamestringLoader animation style (arrows, dots, etc.).

TypeScript Support 🟦

LogPainter provides full TypeScript support. You can import types like this:

import type { ConsoleLoader, ConsoleStyler } from 'logpainter'

License 📜

MIT License © 2025 ChifoDev

0.0.5

6 months ago

0.0.4

6 months ago

0.0.3

7 months ago

0.0.2

7 months ago

0.0.1

7 months ago