@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.
Use the package manager npm to install @qnx/log.
npm install -D @qnx/log
yarn add -D @qnx/log
pnpm install -D @qnx/log
@qnx/response is using error instances of @qnx/errors.
npm install -D chalk
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')
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.
MIT License © 2023-PRESENT Yatendra Kushwaha