@qnx/log
TypeScript icon, indicating that this package has built-in type declarations

0.6.17 • Public • Published

@qnx/log

@qnx/log provides a console logger using the Chalk library for colorful output. It supports different types of messages such as 'info', 'error', 'success', and 'warning', each associated with a specific color.

Installation

Use the package manager npm to install @qnx/log.

npm install -D @qnx/log

You can also use yarn & pnpm

yarn add -D @qnx/log
pnpm install -D @qnx/log

Peer-Dependencies

@qnx/response is using error instances of @qnx/errors.

npm install -D chalk

Usage

Import the module and use the consoleLog function to log messages with different types and corresponding colors.

import { consoleLog } from '@qnx/log'

// Example usage
consoleLog('This is an informational message', { type: 'info' })
consoleLog('An error occurred!', { type: 'error' })
consoleLog('Operation successful', { type: 'success' })
consoleLog('Warning: Proceed with caution', { type: 'warning' })

The consoleLog function takes a string message and an optional configuration object, allowing you to specify the message type. The default type is 'info'.

import { consoleLog } from '@qnx/log'

consoleLog('This is an informational message')

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT License © 2023-PRESENT Yatendra Kushwaha

Readme

Keywords

none

Package Sidebar

Install

npm i @qnx/log

Weekly Downloads

98

Version

0.6.17

License

MIT

Unpacked Size

4.1 kB

Total Files

6

Last publish

Collaborators

  • yatendra121kushwaha