itivrutaha
v3.0.0
Published
( इतिवृत्तः ) — An 👌 easy-to-use, 🛠️ configurable, Bun-first ⚡ console logger.
Downloads
41
Readme
itivrutaha is my first ever JavaScript (initially) project. It is a Bun-first (developed, tested with Bun but also works in Node) console logging module to be used in CLIs, GUI desktop apps & web servers.
Tweet me @vsnthdev, I would love to know your opinion/experience on this project 😍
🚀 Migrating from v2.x
Version 3 is a complete rewrite with several features removed, trimmed down and optimized, while modernizing the codebase and adding Bun.js support.
The v2.x.x
versions can be found in the v2 branch containing the older version of itivrutaha
.
⚠️ Major changes
- Luxon has been replaced in favor of date-format which is more lightweight.
- Removed automatic logs when app starts, and how long it ran when the app exists. (An additional utility will be shipped in a later version.)
- The
verboseIdentifer
andquietIdentifier
config option has been removed. v3
no longer uses TypeScript classes, favors functional approach instead.- Multiple scopes (previously contexts) are now support by single instance of
itivrutaha
unlike previous. - File logging was completely removed.
- The
:message
variable has been replaced by:msg
. - Following variables are no longer supported
:node_path
,:script_path
,:node_version
,:v8_version
,:filename
,:openssl_version
,:electron_version
. These will be added again on request basis.
⚡️ Features
- Easy to customize according to your needs
- Flexible theming support with chalk
- Different log levels (ex. silent, verbose etc) (Planned)
- Ability to log without any ANSI characters (Planned)
- Support for uppercase message types (ex. INFO instead of info) (Planned)
💿 Installation
bun i itivrutaha
npm i itivrutaha # if you're using Node.js
🚴♂️ Quick Start
After itivrutaha
has been installed, you start using it by the following way 👇
import { itivrutaha, defaultConfig } from 'itivrutaha'
const log = itivrutaha(defaultConfig)
// errors can be given directly, logs nicely
log.error(new Error('Ouch!'))
// additional data can also be given for extra context
log.note('Point to be noted', { someData: 'very useful' })
// entire thing can also be an object
log.okay({
msg: 'Not an info message'
})
// a scope can be attached to easily identify
// which part of the application this log came from
log.success('Makes users happy', {}, 'web')
// entire thing can also be an object
log.info({
msg: 'Nice to know something is happening',
scope: 'web',
extra: 'data',
maybeAnError: new Error('Something broke') // will be printed with trace
})
// supports emoji, colors and theming
log.verbose("Always makes developer's life easy 😀")
🛠 Building
bun install
— Installs required dependencies.bun run dev
— Watches for changes & runs TypeScript compiler.bun run build
— Freshly compiles TypeScript code.npm run docs
— Freshly builds by reading code and templates.
ℹ️ Note: You can run bun run examples/index.ts
to test itivrutaha
with the latest code.
📰 License
The itivrutaha project is released under the MIT license.
vsnth.dev · YouTube @vsnthdev · Twitter @vsnthdev · Discord Vasanth Developer