No description
Find a file
2023-09-02 23:59:14 +02:00
.github/workflows 2023.02.05-1 2023-02-05 13:32:26 +01:00
src Cleanup and new features 2023-09-02 23:44:03 +02:00
.eslintrc.json Added eslint configuration 2023-09-02 22:53:43 +02:00
.gitignore Edit gitignore 2023-06-19 17:47:11 +02:00
.npmrc Initial commit 2023-02-03 18:47:53 +01:00
CHANGELOGS.md Cleanup and new features 2023-09-02 23:44:03 +02:00
LICENSE Initial commit 2023-02-03 18:47:53 +01:00
package.json Fixed build script 2023-09-02 23:59:14 +02:00
readme.md Cleanup and new features 2023-09-02 23:44:03 +02:00
tsconfig.json 2023.06.19 2023-06-19 18:59:21 +02:00

COUT

This package allows you to use cout and debug levels in Node.js.

Installation

Run this in your project folder:

npm install node-cout

Usage

Learn how to use node-cout here:

Import

const cc = require('node-cout'); // CommonJS

import cc from 'node-cout'; // MJS or TypeScript

const cout = new cc(1, { save: true, emoji: true, types: ['loading', 'uploading'] });

Parameters:

debugLevel: number
options?: {
  save?: boolean
  emoji?: boolean
  types?: string[]
}

Logging

cout.debug('Hello World', 1); // Sends a debug log (1 is debug level, if its higher than the one defined in the constructor, its not going to be logged.)

cout.info('Hello World'); // Sends an info log

cout.warn('Hello World'); // Sends a warning log

cout.error('Hello World'); // Sends an error log

cout.log('Hello World'); // Sends a normal log

If you want to use the types option, you can do it like this:

cout.debug('Hello World', 1, types);

types can either be a string or an array of strings, and if one of them matches with one of the types defined in the constructor, the log is going to be logged.