1.0.2 • Published 2 years ago
@bash-commands/echo v1.0.2
echo
echo command from bash ported to node.js
Installation
npm install --save @bash-commands/echo
Usage
const echo = require('@bash-commands/echo');
// .... Your code here ....
function main() {
try {
// usage with default options
echo(); // print 'echo working'
// usage with custom options
echo('Hello World!', {
color: 'red',
background: 'black',
filter: 'bright',
});
} catch (err) {
console.error(err);
}
}
Configuration (optional)
Parameter | Type | Default | Description |
---|---|---|---|
message | string | echo working | Message to print to the stdout |
options | object | {color: 'white', background: 'black', filter: 'reset'} | Configuration for the echo command, like passing color for text color, defining the background color (with background ) or applying filter to the stdout text |
Colors and filters
Colors
:
enum Colors {
'black',
'red',
'green',
'yellow',
'blue',
'magenta',
'cyan',
'white',
}
Backgrounds
:
enum Backgrounds {
'black',
'red',
'green',
'yellow',
'blue',
'magenta',
'cyan',
'white',
}
Filters
:
enum Filters {
'reset',
'bright',
'dim',
'underscore',
'blink',
'reverse',
'hidden',
}