6.1.1 • Published 4 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
4 years ago
6.0.4
5 years ago
6.0.3
5 years ago
6.0.2
5 years ago
6.0.1
5 years ago
5.0.3
5 years ago
5.0.2
5 years ago
5.0.1
5 years ago
5.0.0
5 years ago
4.1.0
8 years ago
4.0.11
8 years ago
4.0.10
8 years ago
4.0.9
8 years ago
4.0.8
8 years ago
4.0.7
8 years ago
4.0.6
8 years ago
4.0.5
8 years ago
4.0.4
8 years ago
4.0.3
8 years ago
4.0.2
8 years ago
4.0.1
8 years ago
4.0.0
8 years ago
3.0.3
8 years ago
3.0.2
8 years ago
3.0.1
8 years ago
3.0.0
8 years ago
2.1.0
8 years ago
2.0.4
9 years ago
2.0.2
9 years ago
2.0.1
9 years ago
2.0.0
9 years ago
1.1.2
9 years ago
1.1.1
9 years ago
1.0.7
9 years ago
1.0.6
9 years ago
1.0.5
9 years ago
1.0.4
9 years ago
1.0.3
9 years ago
1.0.2
9 years ago
1.0.1
9 years ago