1.0.2 • Published 2 years ago

@bash-commands/echo v1.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

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)

ParameterTypeDefaultDescription
messagestringecho workingMessage to print to the stdout
optionsobject{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',
  }

License

License: ISC

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago