6.1.1 • Published 6 years ago
colorprint v6.1.1
colorprint
Print ansi-colored message to stdout/stderr.
Installation
npm install colorprint --save
Usage
"use strict";
const colorpint = require('colorpint')
colorpint.notice('This is NOTICE') //Pipe to stdout with magenta color.
colorpint.info('This is INFO') //Pipe to stdout with green color.
colorpint.debug('This is DEBUG') //Pipe to stdout with color.
colorpint.trace('This is TRACE') //Pipe to stdout with white color.
colorpint.warn('This is WARN') //Pipe to stdout with yellow color.
colorpint.error('This is ERROR') //Pipe to stderr with red color.
colorpint.fatal('This is FATAL') //Pipe to stderr with bgRed color.
Using via CIL
Install globally
$ npm install colorprint -g
From Command Line
#!/bin/bash
colorpint notice "This is NOTICE from CLI" # Pipe to stdout with magenta color.
colorpint info "This is INFO from CLI" # Pipe to stdout with green color.
colorpint debug "This is DEBUG from CLI" # Pipe to stdout with color.
colorpint trace "This is TRACE from CLI" # Pipe to stdout with white color.
colorpint warn "This is WARN from CLI" # Pipe to stdout with yellow color.
colorpint error "This is ERROR from CLI" # Pipe to stderr with red color.
colorpint fatal "This is FATAL from CLI" # Pipe to stderr with bgRed color.
Customizing
Customize the whole module.
"use strict";
const colorprint = require('colorprint');
colorprint.PREFIX='Yeah!';
colorprint.INFO_COLOR='blue';
colorprint.info('This will be blue with prefix.');
Create new context to customize.
"use strict";
const Colorprint = require('colorprint/lib/colorprint');
let colorprint = new Colorprint({
PREFIX: '[Foo]',
INFO_COLOR: 'blue'
});
colorprint.info('This will be blue with prefix.');
colorprint is using cli-color for coloring and you can see available colors here.
License
This software is released under the MIT License.
6.1.1
6 years ago
6.0.4
6 years ago
6.0.3
6 years ago
6.0.2
6 years ago
6.0.1
6 years ago
5.0.3
6 years ago
5.0.2
6 years ago
5.0.1
6 years ago
5.0.0
6 years ago
4.1.0
9 years ago
4.0.11
9 years ago
4.0.10
9 years ago
4.0.9
9 years ago
4.0.8
9 years ago
4.0.7
9 years ago
4.0.6
9 years ago
4.0.5
9 years ago
4.0.4
9 years ago
4.0.3
9 years ago
4.0.2
9 years ago
4.0.1
9 years ago
4.0.0
9 years ago
3.0.3
9 years ago
3.0.2
10 years ago
3.0.1
10 years ago
3.0.0
10 years ago
2.1.0
10 years ago
2.0.4
10 years ago
2.0.2
10 years ago
2.0.1
10 years ago
2.0.0
10 years ago
1.1.2
10 years ago
1.1.1
10 years ago
1.0.7
10 years ago
1.0.6
10 years ago
1.0.5
10 years ago
1.0.4
10 years ago
1.0.3
10 years ago
1.0.2
10 years ago
1.0.1
10 years ago