Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-cout

Package Overview
Dependencies
Maintainers
2
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-cout

Standard output module for JavaScript / TypeScript

  • 2023.9.3
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
4
increased by33.33%
Maintainers
2
Weekly downloads
 
Created
Source

node-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

import cc from 'node-cout';

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

You're using CommonJS and can use require() instead of import? Go on troubleshooting.

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.

Troubleshooting

Unfortunately, this is not supported anymore:

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

If you want to import the package in your CommonJS project, add this to your package.json file:

{
  "type": "module"
}

Keywords

FAQs

Package last updated on 09 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc