
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
A basic JavaScript console utility with sprintf and colors support.
##Install
sudo npm install --save cout
##Usage
var cout = require('cout'),
//sprintf(..., ...) or use cout.kawari(..., ...)
sprintf = cout.kawari;
//configure (optional)
cout.config({
cout: ['warn', 'error']
});
//will print on a single line (no color)
cout("Hello", "World", {hello: "world"}, ['hello', 'world'], 1,2,3).end();
//will print on newlines (can be changed through cout.config()) (no color)
cout("Hello", "World", {hello: "world"}, ['hello', 'world'], 1,2,3).endl();
//will print with new line color (see themes for color/level)
cout("Hello", "World", {hello: "world"}, ['hello', 'world'], 1,2,3).warn();
//you can customize the background and styles (see styles)
cout("Hello", "World", {hello: "world"}, ['hello', 'world'], 1,2,3).warn({bg: 'green', style: 'bold'});
//sprintf from the top level (to keep things simple internally)
cout(sprintf('...', '...')).warn();
##Methods
end()
endl()
warn()
data()
debug()
error()
help()
info()
input()
prompt()
silly()
verbose()
##Config The following are the default values but can be changed
//configure
cout.config({
....options....
});
{
//specify which level (Array or String) to display
//by default '*' means display all levels
//if you pass a level array and want to display end() and endl()
//just add 'normal' to the array.
cout: ['*'],
//default theme/colors/levels
theme: {
data: 'grey',
debug: 'blue',
error: 'red',
help: 'cyan',
info: 'green',
input: 'grey',
prompt: 'grey',
silly: 'rainbow',
verbose: 'cyan',
warn: 'yellow',
},
//used for pretty printing json/plain objects
json:{
space: 2
},
//specify the number of new lines.
newline: '\n'
}
##Styles
####Usage
//use style key
{style: ...}
##Background color
####Usage
//use bg key
{bg: ...}
##Time stamp
cout uses Moment.js for time stamps. See Moment.js' docs for formatting and locales.
###Usage
Default: false
Acceptable types: Boolean, Plain Object
//boolean
true or false
timestamp:{
//format the time
format:'dddd',
//change the locale
locale: 'ja',
//spacing: can be tabs or spaces
space: '\n'
}
##Changlog
0.0.1
0.0.2
0.0.3
0.0.4
0.0.5
{cout:...}
to true
or false
.0.0.6
FAQs
A basic JavaScript console utility with sprintf and colors support.
The npm package cout receives a total of 6 weekly downloads. As such, cout popularity was classified as not popular.
We found that cout demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.