cout
A basic JavaScript console utility with sprintf and colors support.
##Install
sudo npm install --save cout
##Usage
var cout = require('cout'),
sprintf = cout.kawari;
cout.config({
cout: ['warn', 'error']
});
cout("Hello", "World", {hello: "world"}, ['hello', 'world'], 1,2,3).end();
cout("Hello", "World", {hello: "world"}, ['hello', 'world'], 1,2,3).endl();
cout("Hello", "World", {hello: "world"}, ['hello', 'world'], 1,2,3).warn();
cout("Hello", "World", {hello: "world"}, ['hello', 'world'], 1,2,3).warn({bg: 'green', style: 'bold'});
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
cout.config({
....options....
});
{
cout: ['*'],
theme: {
data: 'grey',
debug: 'blue',
error: 'red',
help: 'cyan',
info: 'green',
input: 'grey',
prompt: 'grey',
silly: 'rainbow',
verbose: 'cyan',
warn: 'yellow',
},
json:{
space: 2
},
newline: '\n'
}
##Styles
####Usage
{style: ...}
- reset
- bold
- dim
- italic
- underline
- inverse
- hidden
- strikethrough
##Background color
####Usage
{bg: ...}
- black
- red
- green
- yellow
- blue
- magenta
- cyan
- white
##Test
From lack of knowledge, I do not know how to test outputs and colors....that said, there is a test.js file but it's a very limited test. If you know the best way to test please let me know @github issues. Thanks!
##Changlog
0.0.1
0.0.2
- Cleaned code and removed confusing debug statement.
- Updated readme
0.0.3
- Updated readme
- Removed unnecessary comments.
0.0.4
- Added node_modules to .gitignore
0.0.5
- Added boolean support. You can now set
{cout:...}
to true
or false
.